mirror of https://github.com/citusdata/citus.git
extract policy DistributeObjectOps
parent
6a5b126910
commit
e1f9f37206
|
@ -23,15 +23,6 @@ static DistributeObjectOps NoDistributeOps = {
|
|||
.address = NULL,
|
||||
};
|
||||
|
||||
static DistributeObjectOps Any_AlterPolicy = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessAlterPolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION(AlterPolicyStmt, Any_AlterPolicy);
|
||||
|
||||
static DistributeObjectOps Any_AlterRole = {
|
||||
.deparse = DeparseAlterRoleStmt,
|
||||
.qualify = NULL,
|
||||
|
@ -59,15 +50,6 @@ static DistributeObjectOps Any_Cluster = {
|
|||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION(ClusterStmt, Any_Cluster);
|
||||
|
||||
static DistributeObjectOps Any_CreatePolicy = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessCreatePolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION(CreatePolicyStmt, Any_CreatePolicy);
|
||||
|
||||
static DistributeObjectOps Any_Index = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
|
@ -191,15 +173,6 @@ static DistributeObjectOps Index_Drop = {
|
|||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_INDEX, Index_Drop);
|
||||
|
||||
static DistributeObjectOps Policy_Drop = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessDropPolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_POLICY, Policy_Drop);
|
||||
|
||||
static DistributeObjectOps Schema_Drop = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
|
|
|
@ -16,6 +16,36 @@
|
|||
#include "distributed/metadata_cache.h"
|
||||
#include "utils/builtins.h"
|
||||
|
||||
/* DistributeObjectOps */
|
||||
static List * PreprocessCreatePolicyStmt(Node *node, const char *queryString);
|
||||
static DistributeObjectOps Any_CreatePolicy = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessCreatePolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION(CreatePolicyStmt, Any_CreatePolicy);
|
||||
|
||||
static List * PreprocessAlterPolicyStmt(Node *node, const char *queryString);
|
||||
static DistributeObjectOps Any_AlterPolicy = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessAlterPolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION(AlterPolicyStmt, Any_AlterPolicy);
|
||||
|
||||
static List * PreprocessDropPolicyStmt(Node *node, const char *queryString);
|
||||
static DistributeObjectOps Policy_Drop = {
|
||||
.deparse = NULL,
|
||||
.qualify = NULL,
|
||||
.preprocess = PreprocessDropPolicyStmt,
|
||||
.postprocess = NULL,
|
||||
.address = NULL,
|
||||
};
|
||||
REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_POLICY, Policy_Drop);
|
||||
|
||||
/* placeholder for CreatePolicyCommands */
|
||||
List *
|
||||
|
@ -27,7 +57,7 @@ CreatePolicyCommands(Oid relationId)
|
|||
|
||||
|
||||
/* placeholder for PreprocessCreatePolicyStmt */
|
||||
List *
|
||||
static List *
|
||||
PreprocessCreatePolicyStmt(Node *node, const char *queryString)
|
||||
{
|
||||
CreatePolicyStmt *stmt = castNode(CreatePolicyStmt, node);
|
||||
|
@ -47,7 +77,7 @@ PreprocessCreatePolicyStmt(Node *node, const char *queryString)
|
|||
|
||||
|
||||
/* placeholder for PreprocessAlterPolicyStmt */
|
||||
List *
|
||||
static List *
|
||||
PreprocessAlterPolicyStmt(Node *node, const char *queryString)
|
||||
{
|
||||
/* placeholder for future implementation */
|
||||
|
@ -78,7 +108,7 @@ ErrorIfUnsupportedPolicyExpr(Node *expr)
|
|||
|
||||
|
||||
/* placeholder for PreprocessDropPolicyStmt */
|
||||
List *
|
||||
static List *
|
||||
PreprocessDropPolicyStmt(Node *node, const char *queryString)
|
||||
{
|
||||
/* placeholder for future implementation */
|
||||
|
|
|
@ -187,9 +187,6 @@ extern ObjectAddress AlterExtensionStmtObjectAddress(Node *stmt, bool missing_ok
|
|||
extern List * CreatePolicyCommands(Oid relationId);
|
||||
extern void ErrorIfUnsupportedPolicy(Relation relation);
|
||||
extern void ErrorIfUnsupportedPolicyExpr(Node *expr);
|
||||
extern List * PreprocessCreatePolicyStmt(Node *node, const char *queryString);
|
||||
extern List * PreprocessAlterPolicyStmt(Node *node, const char *queryString);
|
||||
extern List * PreprocessDropPolicyStmt(Node *stmt, const char *queryString);
|
||||
extern bool IsPolicyRenameStmt(RenameStmt *stmt);
|
||||
extern void CreatePolicyEventExtendNames(CreatePolicyStmt *stmt, const char *schemaName,
|
||||
uint64 shardId);
|
||||
|
|
Loading…
Reference in New Issue