Issue - (#52): Create a function to return the build version.

Jira: PG-142
This commit is contained in:
Ibrar Ahmed
2020-10-12 17:54:44 +00:00
parent 6170d1f77c
commit b23df84af9
2 changed files with 22 additions and 4 deletions

View File

@@ -16,6 +16,8 @@
PG_MODULE_MAGIC;
#define BUILD_VERSION "0.6.0"
/*---- Initicalization Function Declarations ----*/
void _PG_init(void);
void _PG_fini(void);
@@ -45,6 +47,7 @@ static ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
static ProcessUtility_hook_type prev_ProcessUtility = NULL;
PG_FUNCTION_INFO_V1(pg_stat_monitor_version);
PG_FUNCTION_INFO_V1(pg_stat_monitor_reset);
PG_FUNCTION_INFO_V1(pg_stat_monitor_1_2);
PG_FUNCTION_INFO_V1(pg_stat_monitor_1_3);
@@ -194,6 +197,17 @@ _PG_fini(void)
hash_entry_reset();
}
/*
* Select the version of pg_stat_monitor.
*/
Datum
pg_stat_monitor_version(PG_FUNCTION_ARGS)
{
PG_RETURN_TEXT_P(cstring_to_text(BUILD_VERSION));
}
#define PG_STAT_STATEMENTS_COLS 38 /* maximum of above */
/*
* Post-parse-analysis hook: mark query with a queryId
*/