Adds compile check for pg14

grant_parameter_propagation
gurkanindibay 2024-01-17 11:36:10 +03:00
parent bc945c2c65
commit 0e05dd3c27
5 changed files with 14 additions and 1 deletions

View File

@ -763,6 +763,7 @@ static DistributeObjectOps Index_Drop = {
.markDistributed = false, .markDistributed = false,
}; };
#if PG_VERSION_NUM >= PG_VERSION_15
static DistributeObjectOps Parameter_Grant = { static DistributeObjectOps Parameter_Grant = {
.deparse = DeparseGrantOnParameterStmt, .deparse = DeparseGrantOnParameterStmt,
.qualify = NULL, .qualify = NULL,
@ -773,6 +774,7 @@ static DistributeObjectOps Parameter_Grant = {
.address = NULL, .address = NULL,
.markDistributed = false, .markDistributed = false,
}; };
#endif /* PG_VERSION_NUM >= PG_VERSION_14 */
static DistributeObjectOps Policy_Drop = { static DistributeObjectOps Policy_Drop = {
.deparse = NULL, .deparse = NULL,
@ -2072,11 +2074,12 @@ GetDistributeObjectOps(Node *node)
{ {
return &Database_Grant; return &Database_Grant;
} }
#if PG_VERSION_NUM >= PG_VERSION_15
case OBJECT_PARAMETER_ACL: case OBJECT_PARAMETER_ACL:
{ {
return &Parameter_Grant; return &Parameter_Grant;
} }
#endif
default: default:
{ {

View File

@ -1,3 +1,5 @@
#include "pg_version_constants.h"
#if PG_VERSION_NUM >= PG_VERSION_15
#include "postgres.h" #include "postgres.h"
#include "access/genam.h" #include "access/genam.h"
@ -164,3 +166,4 @@ GrantOnParameters(void)
return commands; return commands;
} }
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */

View File

@ -6,6 +6,8 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "pg_version_constants.h"
#if PG_VERSION_NUM >= PG_VERSION_15
#include "postgres.h" #include "postgres.h"
#include "utils/builtins.h" #include "utils/builtins.h"
@ -60,3 +62,4 @@ DeparseGrantOnParameterStmt(Node *node)
return str.data; return str.data;
} }
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */

View File

@ -447,8 +447,10 @@ extern List * PreprocessDropOwnedStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext); ProcessUtilityContext processUtilityContext);
extern List * PostprocessReassignOwnedStmt(Node *node, const char *queryString); extern List * PostprocessReassignOwnedStmt(Node *node, const char *queryString);
#if PG_VERSION_NUM >= PG_VERSION_15
/* parameter.c - forward declarations */ /* parameter.c - forward declarations */
extern List * PostprocessGrantParameterStmt(Node *node, const char *queryString); extern List * PostprocessGrantParameterStmt(Node *node, const char *queryString);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */
/* policy.c - forward declarations */ /* policy.c - forward declarations */
extern List * CreatePolicyCommands(Oid relationId); extern List * CreatePolicyCommands(Oid relationId);

View File

@ -254,8 +254,10 @@ extern char * DeparseCreateDatabaseStmt(Node *node);
extern char * DeparseDropDatabaseStmt(Node *node); extern char * DeparseDropDatabaseStmt(Node *node);
extern char * DeparseAlterDatabaseRenameStmt(Node *node); extern char * DeparseAlterDatabaseRenameStmt(Node *node);
#if PG_VERSION_NUM >= PG_VERSION_15
/* forward declarations for deparse_parameter_stmts.c*/ /* forward declarations for deparse_parameter_stmts.c*/
extern char * DeparseGrantOnParameterStmt(Node *node); extern char * DeparseGrantOnParameterStmt(Node *node);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */
/* forward declaration for deparse_publication_stmts.c */ /* forward declaration for deparse_publication_stmts.c */
extern char * DeparseCreatePublicationStmt(Node *stmt); extern char * DeparseCreatePublicationStmt(Node *stmt);