mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user