PG-587: pg_stat_monitor: Validate the upgrade from 1.x to 2.0 version (#370)

Disallow V1 API to be used with V2.0 lib and remove pg_stat_monitor--1.0.sql
as part of that. A few adjustments to 1.x to 2.0 upgrade script are also
part of the commit
This commit is contained in:
Muhammad Usama
2023-02-01 01:38:02 +05:00
committed by GitHub
parent 62d2ad6d8e
commit 8193e527da
4 changed files with 25 additions and 413 deletions

View File

@@ -1807,6 +1807,12 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo,
char *parent_query_txt = NULL;
int expected_columns = (api_version >= PGSM_V2_0)?PG_STAT_MONITOR_COLS_V2_0:PG_STAT_MONITOR_COLS_V1_0;
/* Disallow old api usage */
if (api_version < PGSM_V2_0)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("pg_stat_monitor: API version not supported"),
errhint("upgrade pg_stat_monitor extension")));
/* Safety check... */
if (!IsSystemInitialized())
ereport(ERROR,