From c63169f1d818374c70c17216b8dc31fa0236a2f4 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Mon, 27 May 2024 23:16:31 +0900 Subject: [PATCH] Update pg_cheat_funcs for PostgreSQL 17dev compatibility. This commit replaces ShmemVariableCache with TransamVariables due to the rename in v17 (commit b31ba5310b). Also this commit removes the no-op function tuplestore_donestoring(), which was retired in v17 (commit 75680c3d80). --- pg_cheat_funcs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pg_cheat_funcs.c b/pg_cheat_funcs.c index 472c6a3..db202a1 100644 --- a/pg_cheat_funcs.c +++ b/pg_cheat_funcs.c @@ -509,9 +509,6 @@ pg_stat_get_memory_context(PG_FUNCTION_ARGS) PutMemoryContextStatsTupleStore(tupstore, tupdesc, TopMemoryContext, NULL, 0); - /* clean up and return the tuplestore */ - tuplestore_donestoring(tupstore); - return (Datum) 0; } @@ -1035,9 +1032,6 @@ pg_stat_get_syncrep_waiters(PG_FUNCTION_ARGS) } LWLockRelease(SyncRepLock); - /* clean up and return the tuplestore */ - tuplestore_donestoring(tupstore); - return (Datum) 0; } @@ -1105,6 +1099,14 @@ pg_refresh_snapshot(PG_FUNCTION_ARGS) } #endif /* PG_VERSION_NUM >= 90400 */ +/* + * ShmemVariableCache was renamed to TransamVariables in v17 + * (commit b31ba5310b). + */ +#if PG_VERSION_NUM >= 170000 +#define ShmemVariableCache TransamVariables +#endif /* PG_VERSION_NUM >= 170000 */ + /* * Set and return the next transaction ID. */ @@ -1502,7 +1504,6 @@ pg_recovery_settings(PG_FUNCTION_ARGS) tuplestore_putvalues(tupstore, tupdesc, values, nulls); } - tuplestore_donestoring(tupstore); return (Datum) 0; }