mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
PG-194: PostgreSQL 13.3 and 14 support.
This commit is contained in:
@@ -52,10 +52,6 @@ do \
|
||||
void _PG_init(void);
|
||||
void _PG_fini(void);
|
||||
|
||||
/*---- Initicalization Function Declarations ----*/
|
||||
void _PG_init(void);
|
||||
void _PG_fini(void);
|
||||
|
||||
/*---- Local variables ----*/
|
||||
|
||||
/* Current nesting depth of ExecutorRun+ProcessUtility calls */
|
||||
@@ -123,7 +119,7 @@ static void pgss_ExecutorFinish(QueryDesc *queryDesc);
|
||||
static void pgss_ExecutorEnd(QueryDesc *queryDesc);
|
||||
static bool pgss_ExecutorCheckPerms(List *rt, bool abort);
|
||||
|
||||
#if PG_VERSION_NUM >= 130000
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
static PlannedStmt * pgss_planner_hook(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams);
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
bool readOnlyTree,
|
||||
@@ -131,6 +127,13 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
ParamListInfo params, QueryEnvironment *queryEnv,
|
||||
DestReceiver *dest,
|
||||
QueryCompletion *qc);
|
||||
#elif PG_VERSION_NUM >= 130000
|
||||
static PlannedStmt * pgss_planner_hook(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams);
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
ProcessUtilityContext context,
|
||||
ParamListInfo params, QueryEnvironment *queryEnv,
|
||||
DestReceiver *dest,
|
||||
QueryCompletion *qc);
|
||||
#else
|
||||
static void BufferUsageAccumDiff(BufferUsage* bufusage, BufferUsage* pgBufferUsage, BufferUsage* bufusage_start);
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
@@ -215,7 +218,6 @@ void
|
||||
_PG_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
elog(DEBUG2, "pg_stat_monitor: %s()", __FUNCTION__);
|
||||
/*
|
||||
* In order to create our shared memory area, we have to be loaded via
|
||||
@@ -762,7 +764,7 @@ pgss_planner_hook(Query *parse, const char *query_string, int cursorOptions, Par
|
||||
/*
|
||||
* ProcessUtility hook
|
||||
*/
|
||||
#if PG_VERSION_NUM >= 130000
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
bool readOnlyTree,
|
||||
ProcessUtilityContext context,
|
||||
@@ -770,6 +772,13 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
DestReceiver *dest,
|
||||
QueryCompletion *qc)
|
||||
|
||||
#elif PG_VERSION_NUM >= 130000
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
ProcessUtilityContext context,
|
||||
ParamListInfo params, QueryEnvironment *queryEnv,
|
||||
DestReceiver *dest,
|
||||
QueryCompletion *qc)
|
||||
|
||||
#else
|
||||
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
ProcessUtilityContext context, ParamListInfo params,
|
||||
@@ -811,7 +820,7 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
INSTR_TIME_SET_CURRENT(start);
|
||||
PG_TRY();
|
||||
{
|
||||
#if PG_VERSION_NUM >= 130000
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
readOnlyTree,
|
||||
@@ -824,6 +833,17 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
#elif PG_VERSION_NUM >= 130000
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
else
|
||||
standard_ProcessUtility(pstmt, queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
#else
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
@@ -833,7 +853,8 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
else
|
||||
standard_ProcessUtility(pstmt, queryString,
|
||||
context, params, queryEnv,
|
||||
dest);
|
||||
dest,
|
||||
completionTag);
|
||||
#endif
|
||||
}
|
||||
PG_CATCH();
|
||||
@@ -871,7 +892,7 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if PG_VERSION_NUM >= 130000
|
||||
#if PG_VERSION_NUM >= 140000
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
readOnlyTree,
|
||||
@@ -883,6 +904,16 @@ static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
#elif PG_VERSION_NUM >= 130000
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
standard_ProcessUtility(pstmt, queryString,
|
||||
context, params, queryEnv,
|
||||
dest,
|
||||
qc);
|
||||
#else
|
||||
if (prev_ProcessUtility)
|
||||
prev_ProcessUtility(pstmt, queryString,
|
||||
|
||||
Reference in New Issue
Block a user