Fixes postgres 14 errors

grant_parameter_propagation
gurkanindibay 2024-01-17 13:51:12 +03:00
parent 70f1420811
commit 1247c0d4b5
3 changed files with 14 additions and 0 deletions

View File

@ -4725,8 +4725,10 @@ PropagateNodeWideObjectsCommandList(void)
List *alterRoleSetCommands = GenerateAlterRoleSetCommandForRole(InvalidOid);
ddlCommands = list_concat(ddlCommands, alterRoleSetCommands);
}
#if PG_VERSION_NUM >= PG_VERSION_15
List *grantOnParameterCommands = GrantOnParameters();
ddlCommands = list_concat(ddlCommands, grantOnParameterCommands);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */
return ddlCommands;
}

View File

@ -12,7 +12,10 @@
#include "nodes/parsenodes.h"
#if PG_VERSION_NUM >= PG_VERSION_15
extern List * GrantOnParameters(void);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */
extern char * GenerateSetRoleQuery(Oid roleOid);
extern GrantStmt * GenerateGrantStmtForRights(ObjectType objectType,
Oid roleOid,

View File

@ -0,0 +1,9 @@
--
-- PG15
--
SHOW server_version \gset
SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15
\gset
\if :server_version_ge_15
\else
\q