Skip to content

Commit

Permalink
Update pg_cheat_funcs for PostgreSQL 17dev compatibility.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
MasaoFujii committed May 27, 2024
1 parent 599fe6c commit c63169f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pg_cheat_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1502,7 +1504,6 @@ pg_recovery_settings(PG_FUNCTION_ARGS)
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}

tuplestore_donestoring(tupstore);
return (Datum) 0;
}

Expand Down

0 comments on commit c63169f

Please sign in to comment.