Fixes indentation

pull/7270/head
gindibay 2023-10-04 13:32:39 +03:00
parent 1e7c18cb61
commit cef9ac702e
7 changed files with 487 additions and 422 deletions

View File

@ -37,33 +37,33 @@
#include "distributed/adaptive_executor.h"
/* macros to add DefElems to a list */
#define DEFELEM_ADD_STRING(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *)makeString(value), -1); \
options = lappend(options, elem); \
#define DEFELEM_ADD_STRING(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *) makeString(value), -1); \
options = lappend(options, elem); \
}
#define DEFELEM_ADD_BOOL(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *)makeBoolean(value), -1); \
options = lappend(options, elem); \
#define DEFELEM_ADD_BOOL(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *) makeBoolean(value), -1); \
options = lappend(options, elem); \
}
#define DEFELEM_ADD_INT(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *)makeInteger(value), -1); \
options = lappend(options, elem); \
#define DEFELEM_ADD_INT(options, key, value) \
{ \
DefElem *elem = makeDefElem(key, (Node *) makeInteger(value), -1); \
options = lappend(options, elem); \
}
static AlterOwnerStmt *RecreateAlterDatabaseOwnerStmt(Oid databaseOid);
static AlterOwnerStmt * RecreateAlterDatabaseOwnerStmt(Oid databaseOid);
static List *CreateDDLTaskList(char *command, List *workerNodeList,
bool outsideTransaction);
static List * CreateDDLTaskList(char *command, List *workerNodeList,
bool outsideTransaction);
PG_FUNCTION_INFO_V1(citus_internal_database_command);
static Oid get_database_owner(Oid db_oid);
List *PreprocessGrantOnDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
List * PreprocessGrantOnDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
/* controlled via GUC */
bool EnableCreateDatabasePropagation = true;
@ -79,13 +79,14 @@ AlterDatabaseOwnerObjectAddress(Node *node, bool missing_ok, bool isPostprocess)
AlterOwnerStmt *stmt = castNode(AlterOwnerStmt, node);
Assert(stmt->objectType == OBJECT_DATABASE);
Oid databaseOid = get_database_oid(strVal((String *)stmt->object), missing_ok);
Oid databaseOid = get_database_oid(strVal((String *) stmt->object), missing_ok);
ObjectAddress *address = palloc0(sizeof(ObjectAddress));
ObjectAddressSet(*address, DatabaseRelationId, databaseOid);
return list_make1(address);
}
/*
* DatabaseOwnerDDLCommands returns a list of sql statements to idempotently apply a
* change of the database owner on the workers so that the database is owned by the same
@ -94,10 +95,11 @@ AlterDatabaseOwnerObjectAddress(Node *node, bool missing_ok, bool isPostprocess)
List *
DatabaseOwnerDDLCommands(const ObjectAddress *address)
{
Node *stmt = (Node *)RecreateAlterDatabaseOwnerStmt(address->objectId);
Node *stmt = (Node *) RecreateAlterDatabaseOwnerStmt(address->objectId);
return list_make1(DeparseTreeNode(stmt));
}
/*
* RecreateAlterDatabaseOwnerStmt creates an AlterOwnerStmt that represents the operation
* of changing the owner of the database to its current owner.
@ -108,7 +110,7 @@ RecreateAlterDatabaseOwnerStmt(Oid databaseOid)
AlterOwnerStmt *stmt = makeNode(AlterOwnerStmt);
stmt->objectType = OBJECT_DATABASE;
stmt->object = (Node *)makeString(get_database_name(databaseOid));
stmt->object = (Node *) makeString(get_database_name(databaseOid));
Oid ownerOid = get_database_owner(databaseOid);
stmt->newowner = makeNode(RoleSpec);
@ -118,6 +120,7 @@ RecreateAlterDatabaseOwnerStmt(Oid databaseOid)
return stmt;
}
/*
* get_database_owner returns the Oid of the role owning the database
*/
@ -131,13 +134,14 @@ get_database_owner(Oid db_oid)
errmsg("database with OID %u does not exist", db_oid)));
}
Oid dba = ((Form_pg_database)GETSTRUCT(tuple))->datdba;
Oid dba = ((Form_pg_database) GETSTRUCT(tuple))->datdba;
ReleaseSysCache(tuple);
return dba;
}
/*
* PreprocessGrantOnDatabaseStmt is executed before the statement is applied to the local
* postgres instance.
@ -166,15 +170,16 @@ PreprocessGrantOnDatabaseStmt(Node *node, const char *queryString,
EnsureCoordinator();
char *sql = DeparseTreeNode((Node *)stmt);
char *sql = DeparseTreeNode((Node *) stmt);
List *commands = list_make3(DISABLE_DDL_PROPAGATION,
(void *)sql,
(void *) sql,
ENABLE_DDL_PROPAGATION);
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
}
/*
* PreprocessAlterDatabaseStmt is executed before the statement is applied to the local
* postgres instance.
@ -195,15 +200,16 @@ PreprocessAlterDatabaseStmt(Node *node, const char *queryString,
EnsureCoordinator();
char *sql = DeparseTreeNode((Node *)stmt);
char *sql = DeparseTreeNode((Node *) stmt);
List *commands = list_make3(DISABLE_DDL_PROPAGATION,
(void *)sql,
(void *) sql,
ENABLE_DDL_PROPAGATION);
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
}
#if PG_VERSION_NUM >= PG_VERSION_15
/*
@ -226,15 +232,16 @@ PreprocessAlterDatabaseRefreshCollStmt(Node *node, const char *queryString,
EnsureCoordinator();
char *sql = DeparseTreeNode((Node *)stmt);
char *sql = DeparseTreeNode((Node *) stmt);
List *commands = list_make3(DISABLE_DDL_PROPAGATION,
(void *)sql,
(void *) sql,
ENABLE_DDL_PROPAGATION);
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
}
#endif
/*
@ -320,7 +327,8 @@ PostprocessCreateDatabaseStmt(Node *node, const char *queryString)
*
* We do not do this right now because of the AssignDatabaseToShard at the end.
*/
List *workerNodes = TargetWorkerSetNodeList(NON_COORDINATOR_METADATA_NODES, RowShareLock);
List *workerNodes = TargetWorkerSetNodeList(NON_COORDINATOR_METADATA_NODES,
RowShareLock);
if (list_length(workerNodes) > 0)
{
char *createDatabaseCommand = DeparseTreeNode(node);
@ -345,21 +353,22 @@ PostprocessCreateDatabaseStmt(Node *node, const char *queryString)
}
/* synchronize pg_dist_object records */
ObjectAddress dbAddress = {0};
ObjectAddress dbAddress = { 0 };
ObjectAddressSet(dbAddress, DatabaseRelationId, databaseOid);
MarkObjectDistributed(&dbAddress);
return NIL;
}
/*
* citus_internal_database_command is an internal UDF to
* create/drop a database in an idempotent maner without
* transaction block restrictions.
*/
Datum citus_internal_database_command(PG_FUNCTION_ARGS)
Datum
citus_internal_database_command(PG_FUNCTION_ARGS)
{
int saveNestLevel = NewGUCNestLevel();
text *commandText = PG_GETARG_TEXT_P(0);
@ -367,7 +376,7 @@ Datum citus_internal_database_command(PG_FUNCTION_ARGS)
Node *parseTree = ParseTreeNode(command);
ereport(NOTICE, (errmsg("test internal pre"),
errhint("test pre hint")));
errhint("test pre hint")));
set_config_option("citus.enable_ddl_propagation", "off",
(superuser() ? PGC_SUSET : PGC_USERSET), PGC_S_SESSION,
@ -386,7 +395,7 @@ Datum citus_internal_database_command(PG_FUNCTION_ARGS)
if (!OidIsValid(databaseOid))
{
createdb(NULL, (CreatedbStmt *)parseTree);
createdb(NULL, (CreatedbStmt *) parseTree);
}
else
{
@ -407,7 +416,7 @@ Datum citus_internal_database_command(PG_FUNCTION_ARGS)
else
{
/* remove database from pg_dist_object */
ObjectAddress dbAddress = {0};
ObjectAddress dbAddress = { 0 };
ObjectAddressSet(dbAddress, DatabaseRelationId, databaseOid);
if (IsObjectDistributed(&dbAddress))
@ -415,10 +424,10 @@ Datum citus_internal_database_command(PG_FUNCTION_ARGS)
UnmarkObjectDistributed(&dbAddress);
}
// /* remove database from database shards */
// DeleteDatabaseShardByDatabaseIdLocally(databaseOid);
/* / * remove database from database shards * / */
/* DeleteDatabaseShardByDatabaseIdLocally(databaseOid); */
DropDatabase(NULL, (DropdbStmt *)parseTree);
DropDatabase(NULL, (DropdbStmt *) parseTree);
}
}
else
@ -431,6 +440,7 @@ Datum citus_internal_database_command(PG_FUNCTION_ARGS)
PG_RETURN_VOID();
}
List *
PreprocessDropDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext)
@ -440,7 +450,7 @@ PreprocessDropDatabaseStmt(Node *node, const char *queryString,
return NIL;
}
DropdbStmt *stmt = (DropdbStmt *)node;
DropdbStmt *stmt = (DropdbStmt *) node;
char *databaseName = stmt->dbname;
bool missingOk = true;
Oid databaseOid = get_database_oid(databaseName, missingOk);
@ -450,14 +460,15 @@ PreprocessDropDatabaseStmt(Node *node, const char *queryString,
return NIL;
}
ObjectAddress dbAddress = {0};
ObjectAddress dbAddress = { 0 };
ObjectAddressSet(dbAddress, DatabaseRelationId, databaseOid);
if (!IsObjectDistributed(&dbAddress))
{
return NIL;
}
List *workerNodes = TargetWorkerSetNodeList(NON_COORDINATOR_METADATA_NODES, RowShareLock);
List *workerNodes = TargetWorkerSetNodeList(NON_COORDINATOR_METADATA_NODES,
RowShareLock);
if (list_length(workerNodes) == 0)
{
return NIL;

View File

@ -1355,6 +1355,7 @@ GetDistributeObjectOps(Node *node)
{
return &Database_Alter;
}
case T_CreatedbStmt:
{
return &Database_Create;

View File

@ -694,7 +694,7 @@ ProcessUtilityInternal(PlannedStmt *pstmt,
}
/* inform the user about potential caveats */
if (IsA(parsetree, CreatedbStmt) &&!EnableCreateDatabasePropagation)
if (IsA(parsetree, CreatedbStmt) && !EnableCreateDatabasePropagation)
{
if (EnableUnsupportedFeatureMessages)
{

View File

@ -34,7 +34,7 @@ char *
DeparseAlterDatabaseOwnerStmt(Node *node)
{
AlterOwnerStmt *stmt = castNode(AlterOwnerStmt, node);
StringInfoData str = {0};
StringInfoData str = { 0 };
initStringInfo(&str);
Assert(stmt->objectType == OBJECT_DATABASE);
@ -44,6 +44,7 @@ DeparseAlterDatabaseOwnerStmt(Node *node)
return str.data;
}
static void
AppendAlterDatabaseOwnerStmt(StringInfo buf, AlterOwnerStmt *stmt)
{
@ -51,17 +52,18 @@ AppendAlterDatabaseOwnerStmt(StringInfo buf, AlterOwnerStmt *stmt)
appendStringInfo(buf,
"ALTER DATABASE %s OWNER TO %s;",
quote_identifier(strVal((String *)stmt->object)),
quote_identifier(strVal((String *) stmt->object)),
RoleSpecString(stmt->newowner, true));
}
static void
AppendGrantDatabases(StringInfo buf, GrantStmt *stmt)
{
ListCell *cell = NULL;
appendStringInfo(buf, " ON DATABASE ");
foreach (cell, stmt->objects)
foreach(cell, stmt->objects)
{
char *database = strVal(lfirst(cell));
appendStringInfoString(buf, quote_identifier(database));
@ -72,6 +74,7 @@ AppendGrantDatabases(StringInfo buf, GrantStmt *stmt)
}
}
static void
AppendGrantOnDatabaseStmt(StringInfo buf, GrantStmt *stmt)
{
@ -84,12 +87,14 @@ AppendGrantOnDatabaseStmt(StringInfo buf, GrantStmt *stmt)
AppendGrantSharedSuffix(buf, stmt);
}
static void
AppendDefElemConnLimit(StringInfo buf, DefElem *def)
{
appendStringInfo(buf, " CONNECTION LIMIT %ld", (long int)defGetNumeric(def));
appendStringInfo(buf, " CONNECTION LIMIT %ld", (long int) defGetNumeric(def));
}
static void
AppendAlterDatabaseStmt(StringInfo buf, AlterDatabaseStmt *stmt)
{
@ -99,7 +104,7 @@ AppendAlterDatabaseStmt(StringInfo buf, AlterDatabaseStmt *stmt)
{
ListCell *cell = NULL;
appendStringInfo(buf, "WITH ");
foreach (cell, stmt->options)
foreach(cell, stmt->options)
{
DefElem *def = castNode(DefElem, lfirst(cell));
if (strcmp(def->defname, "is_template") == 0)
@ -128,13 +133,14 @@ AppendAlterDatabaseStmt(StringInfo buf, AlterDatabaseStmt *stmt)
appendStringInfo(buf, ";");
}
char *
DeparseGrantOnDatabaseStmt(Node *node)
{
GrantStmt *stmt = castNode(GrantStmt, node);
Assert(stmt->objtype == OBJECT_DATABASE);
StringInfoData str = {0};
StringInfoData str = { 0 };
initStringInfo(&str);
AppendGrantOnDatabaseStmt(&str, stmt);
@ -142,12 +148,13 @@ DeparseGrantOnDatabaseStmt(Node *node)
return str.data;
}
char *
DeparseAlterDatabaseStmt(Node *node)
{
AlterDatabaseStmt *stmt = castNode(AlterDatabaseStmt, node);
StringInfoData str = {0};
StringInfoData str = { 0 };
initStringInfo(&str);
AppendAlterDatabaseStmt(&str, stmt);
@ -155,11 +162,12 @@ DeparseAlterDatabaseStmt(Node *node)
return str.data;
}
#if PG_VERSION_NUM >= PG_VERSION_15
char *
DeparseAlterDatabaseRefreshCollStmt(Node *node)
{
AlterDatabaseRefreshCollStmt *stmt = (AlterDatabaseRefreshCollStmt *)node;
AlterDatabaseRefreshCollStmt *stmt = (AlterDatabaseRefreshCollStmt *) node;
StringInfoData str;
initStringInfo(&str);
@ -171,6 +179,7 @@ DeparseAlterDatabaseRefreshCollStmt(Node *node)
return str.data;
}
#endif
static void
@ -183,12 +192,13 @@ AppendAlterDatabaseSetStmt(StringInfo buf, AlterDatabaseSetStmt *stmt)
AppendVariableSet(buf, varSetStmt);
}
char *
DeparseAlterDatabaseSetStmt(Node *node)
{
AlterDatabaseSetStmt *stmt = castNode(AlterDatabaseSetStmt, node);
StringInfoData str = {0};
StringInfoData str = { 0 };
initStringInfo(&str);
AppendAlterDatabaseSetStmt(&str, stmt);
@ -196,6 +206,7 @@ DeparseAlterDatabaseSetStmt(Node *node)
return str.data;
}
static void
AppendCreatedbStmt(StringInfo buf, CreatedbStmt *stmt)
{
@ -325,11 +336,12 @@ AppendCreatedbStmt(StringInfo buf, CreatedbStmt *stmt)
}
}
char *
DeparseCreateDatabaseStmt(Node *node)
{
CreatedbStmt *stmt = castNode(CreatedbStmt, node);
StringInfoData str = {0};
StringInfoData str = { 0 };
initStringInfo(&str);
AppendCreatedbStmt(&str, stmt);
@ -337,6 +349,7 @@ DeparseCreateDatabaseStmt(Node *node)
return str.data;
}
static void
AppendDropDatabaseStmt(StringInfo buf, DropdbStmt *stmt)
{
@ -361,6 +374,7 @@ AppendDropDatabaseStmt(StringInfo buf, DropdbStmt *stmt)
}
}
char *
DeparseDropDatabaseStmt(Node *node)
{
@ -372,6 +386,3 @@ DeparseDropDatabaseStmt(Node *node)
return str.data;
}

View File

@ -2769,8 +2769,6 @@ DistRebalanceStrategyRelationId(void)
}
/* return oid of pg_dist_object relation */
Oid
DistObjectRelationId(void)
@ -5403,8 +5401,6 @@ DeformedDistShardTupleToShardInterval(Datum *datumArray, bool *isNullArray,
}
/*
* CachedRelationLookup performs a cached lookup for the relation
* relationName, with the result cached in *cachedOid.

View File

@ -42,11 +42,11 @@ extern bool EnforceLocalObjectRestrictions;
extern void SwitchToSequentialAndLocalExecutionIfRelationNameTooLong(Oid relationId,
char *
finalRelationName);
finalRelationName);
extern void SwitchToSequentialAndLocalExecutionIfPartitionNameTooLong(Oid
parentRelationId,
parentRelationId,
Oid
partitionRelationId);
partitionRelationId);
/* DistOpsOperationType to be used in DistributeObjectOps */
typedef enum DistOpsOperationType
@ -99,7 +99,7 @@ typedef struct DistributeObjectOps
#define CITUS_TRUNCATE_TRIGGER_NAME "citus_truncate_trigger"
const DistributeObjectOps *GetDistributeObjectOps(Node *node);
const DistributeObjectOps * GetDistributeObjectOps(Node *node);
/*
* Flags that can be passed to GetForeignKeyOids to indicate
@ -172,21 +172,23 @@ extern const char *TenantOperationNames[TOTAL_TENANT_OPERATION];
extern void SaveBeginCommandProperties(TransactionStmt *transactionStmt);
/* cluster.c - forward declarations */
extern List *PreprocessClusterStmt(Node *node, const char *clusterCommand,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessClusterStmt(Node *node, const char *clusterCommand,
ProcessUtilityContext processUtilityContext);
/* common.c - forward declarations*/
extern List *PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt,
const char *queryString);
extern List *PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
extern List * PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt,
const char *queryString);
extern List * PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString);
extern List * PreprocessDropDistributedObjectStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PostprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString);
extern List *PreprocessDropDistributedObjectStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *DropTextSearchConfigObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *DropTextSearchDictObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
processUtilityContext);
extern List * DropTextSearchConfigObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * DropTextSearchDictObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
/* index.c */
typedef void (*PGIndexProcessor)(Form_pg_index, List **, int);
@ -195,78 +197,87 @@ typedef void (*PGIndexProcessor)(Form_pg_index, List **, int);
extern bool CallDistributedProcedureRemotely(CallStmt *callStmt, DestReceiver *dest);
/* collation.c - forward declarations */
extern char *CreateCollationDDL(Oid collationId);
extern List *CreateCollationDDLsIdempotent(Oid collationId);
extern List *AlterCollationOwnerObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *RenameCollationStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *AlterCollationSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern char *GenerateBackupNameForCollationCollision(const ObjectAddress *address);
extern List *DefineCollationStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern char * CreateCollationDDL(Oid collationId);
extern List * CreateCollationDDLsIdempotent(Oid collationId);
extern List * AlterCollationOwnerObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * RenameCollationStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * AlterCollationSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern char * GenerateBackupNameForCollationCollision(const ObjectAddress *address);
extern List * DefineCollationStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
/* database.c - forward declarations */
extern List *AlterDatabaseOwnerObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *DatabaseOwnerDDLCommands(const ObjectAddress *address);
extern List * AlterDatabaseOwnerObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * DatabaseOwnerDDLCommands(const ObjectAddress *address);
extern List *PreprocessGrantOnDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterDatabaseRefreshCollStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PreprocessAlterDatabaseSetStmt(Node *node, const char *queryString,
extern List * PreprocessGrantOnDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessCreateDatabaseStmt(Node *node, const char *queryString);
extern List *PreprocessDropDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
/* domain.c - forward declarations */
extern List *CreateDomainStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterDomainStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *DomainRenameConstraintStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterDomainOwnerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *RenameDomainStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern CreateDomainStmt *RecreateDomainStmt(Oid domainOid);
extern List * PreprocessAlterDatabaseRefreshCollStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PreprocessAlterDatabaseSetStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessCreateDatabaseStmt(Node *node, const char *queryString);
extern List * PreprocessDropDatabaseStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
/* domain.c - forward declarations */
extern List * CreateDomainStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterDomainStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * DomainRenameConstraintStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterDomainOwnerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * RenameDomainStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern CreateDomainStmt * RecreateDomainStmt(Oid domainOid);
extern Oid get_constraint_typid(Oid conoid);
/* extension.c - forward declarations */
extern bool IsDropCitusExtensionStmt(Node *parsetree);
extern List *GetDependentFDWsToExtension(Oid extensionId);
extern List * GetDependentFDWsToExtension(Oid extensionId);
extern bool IsCreateAlterExtensionUpdateCitusStmt(Node *parsetree);
extern void PreprocessCreateExtensionStmtForCitusColumnar(Node *parsetree);
extern void PreprocessAlterExtensionCitusStmtForCitusColumnar(Node *parsetree);
extern void PostprocessAlterExtensionCitusStmtForCitusColumnar(Node *parsetree);
extern bool ShouldMarkRelationDistributed(Oid relationId);
extern void ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree);
extern List *PostprocessCreateExtensionStmt(Node *stmt, const char *queryString);
extern List *PreprocessDropExtensionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterExtensionSchemaStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PostprocessAlterExtensionSchemaStmt(Node *stmt,
const char *queryString);
extern List *PreprocessAlterExtensionUpdateStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessCreateExtensionStmt(Node *stmt, const char *queryString);
extern List * PreprocessDropExtensionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterExtensionSchemaStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterExtensionSchemaStmt(Node *stmt,
const char *queryString);
extern List * PreprocessAlterExtensionUpdateStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern void PostprocessAlterExtensionCitusUpdateStmt(Node *node);
extern List *PreprocessAlterExtensionContentsStmt(Node *node,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *CreateExtensionDDLCommand(const ObjectAddress *extensionAddress);
extern List *AlterExtensionSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *AlterExtensionUpdateStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * PreprocessAlterExtensionContentsStmt(Node *node,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * CreateExtensionDDLCommand(const ObjectAddress *extensionAddress);
extern List * AlterExtensionSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * AlterExtensionUpdateStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern void CreateExtensionWithVersion(char *extname, char *extVersion);
extern void AlterExtensionUpdateStmt(char *extname, char *extVersion);
extern int GetExtensionVersionNumber(char *extVersion);
@ -285,21 +296,21 @@ extern void ErrorOutForFKeyBetweenPostgresAndCitusLocalTable(Oid localTableId);
extern bool ColumnReferencedByAnyForeignKey(char *columnName, Oid relationId);
extern bool ColumnAppearsInForeignKey(char *columnName, Oid relationId);
extern bool ColumnAppearsInForeignKeyToReferenceTable(char *columnName, Oid
relationId);
extern List *GetReferencingForeignConstaintCommands(Oid relationOid);
extern List *GetForeignConstraintToReferenceTablesCommands(Oid relationId);
extern List *GetForeignConstraintFromOtherReferenceTablesCommands(Oid relationId);
extern List *GetForeignConstraintToDistributedTablesCommands(Oid relationId);
extern List *GetForeignConstraintFromDistributedTablesCommands(Oid relationId);
extern List *GetForeignConstraintCommandsInternal(Oid relationId, int flags);
relationId);
extern List * GetReferencingForeignConstaintCommands(Oid relationOid);
extern List * GetForeignConstraintToReferenceTablesCommands(Oid relationId);
extern List * GetForeignConstraintFromOtherReferenceTablesCommands(Oid relationId);
extern List * GetForeignConstraintToDistributedTablesCommands(Oid relationId);
extern List * GetForeignConstraintFromDistributedTablesCommands(Oid relationId);
extern List * GetForeignConstraintCommandsInternal(Oid relationId, int flags);
extern Oid DropFKeysAndUndistributeTable(Oid relationId);
extern void DropFKeysRelationInvolvedWithTableType(Oid relationId, int tableTypeFlag);
extern List *GetFKeyCreationCommandsRelationInvolvedWithTableType(Oid relationId,
int tableTypeFlag);
extern List * GetFKeyCreationCommandsRelationInvolvedWithTableType(Oid relationId,
int tableTypeFlag);
extern bool AnyForeignKeyDependsOnIndex(Oid indexId);
extern bool HasForeignKeyWithLocalTable(Oid relationId);
extern bool HasForeignKeyToReferenceTable(Oid relationOid);
extern List *GetForeignKeysFromLocalTables(Oid relationId);
extern List * GetForeignKeysFromLocalTables(Oid relationId);
extern bool TableReferenced(Oid relationOid);
extern bool TableReferencing(Oid relationOid);
extern bool ConstraintIsAUniquenessConstraint(char *inputConstaintName, Oid relationId);
@ -308,269 +319,289 @@ extern bool ConstraintWithNameIsOfType(char *inputConstaintName, Oid relationId,
char targetConstraintType);
extern bool ConstraintWithIdIsOfType(Oid constraintId, char targetConstraintType);
extern bool TableHasExternalForeignKeys(Oid relationId);
extern List *GetForeignKeyOids(Oid relationId, int flags);
extern List * GetForeignKeyOids(Oid relationId, int flags);
extern Oid GetReferencedTableId(Oid foreignKeyId);
extern Oid GetReferencingTableId(Oid foreignKeyId);
extern bool RelationInvolvedInAnyNonInheritedForeignKeys(Oid relationId);
/* foreign_data_wrapper.c - forward declarations */
extern List *PreprocessGrantOnFDWStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern Acl *GetPrivilegesForFDW(Oid FDWOid);
extern List * PreprocessGrantOnFDWStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern Acl * GetPrivilegesForFDW(Oid FDWOid);
/* foreign_server.c - forward declarations */
extern List *PreprocessGrantOnForeignServerStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *CreateForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *RenameForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterForeignServerOwnerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *GetForeignServerCreateDDLCommand(Oid serverId);
extern List * PreprocessGrantOnForeignServerStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * CreateForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * RenameForeignServerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterForeignServerOwnerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * GetForeignServerCreateDDLCommand(Oid serverId);
/* foreign_table.c - forward declarations */
extern List *PreprocessAlterForeignTableSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PreprocessAlterForeignTableSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
/* function.c - forward declarations */
extern List *PreprocessCreateFunctionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessCreateFunctionStmt(Node *stmt,
const char *queryString);
extern List *CreateFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *DefineAggregateStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *PreprocessAlterFunctionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *AlterFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *RenameFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *AlterFunctionOwnerObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *AlterFunctionSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *PreprocessAlterFunctionDependsStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *AlterFunctionDependsStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *PreprocessGrantOnFunctionStmt(Node *node, const char *queryString,
extern List * PreprocessCreateFunctionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessGrantOnFunctionStmt(Node *node, const char *queryString);
extern List * PostprocessCreateFunctionStmt(Node *stmt,
const char *queryString);
extern List * CreateFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * DefineAggregateStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * PreprocessAlterFunctionStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * AlterFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * RenameFunctionStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * AlterFunctionOwnerObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * AlterFunctionSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * PreprocessAlterFunctionDependsStmt(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * AlterFunctionDependsStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * PreprocessGrantOnFunctionStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessGrantOnFunctionStmt(Node *node, const char *queryString);
/* grant.c - forward declarations */
extern List *PreprocessGrantStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessGrantStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern void deparsePrivileges(StringInfo privsString, GrantStmt *grantStmt);
extern void deparseGrantees(StringInfo granteesString, GrantStmt *grantStmt);
/* index.c - forward declarations */
extern bool IsIndexRenameStmt(RenameStmt *renameStmt);
extern List *PreprocessIndexStmt(Node *createIndexStatement,
const char *createIndexCommand,
ProcessUtilityContext processUtilityContext);
extern char *ChooseIndexName(const char *tabname, Oid namespaceId,
List *colnames, List *exclusionOpNames,
bool primary, bool isconstraint);
extern char *ChooseIndexNameAddition(List *colnames);
extern List *ChooseIndexColumnNames(List *indexElems);
extern List * PreprocessIndexStmt(Node *createIndexStatement,
const char *createIndexCommand,
ProcessUtilityContext processUtilityContext);
extern char * ChooseIndexName(const char *tabname, Oid namespaceId,
List *colnames, List *exclusionOpNames,
bool primary, bool isconstraint);
extern char * ChooseIndexNameAddition(List *colnames);
extern List * ChooseIndexColumnNames(List *indexElems);
extern LOCKMODE GetCreateIndexRelationLockMode(IndexStmt *createIndexStatement);
extern List *PreprocessReindexStmt(Node *ReindexStatement,
const char *ReindexCommand,
ProcessUtilityContext processUtilityContext);
extern List *ReindexStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *PreprocessDropIndexStmt(Node *dropIndexStatement,
const char *dropIndexCommand,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessIndexStmt(Node *node,
const char *queryString);
extern List * PreprocessReindexStmt(Node *ReindexStatement,
const char *ReindexCommand,
ProcessUtilityContext processUtilityContext);
extern List * ReindexStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List * PreprocessDropIndexStmt(Node *dropIndexStatement,
const char *dropIndexCommand,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessIndexStmt(Node *node,
const char *queryString);
extern void ErrorIfUnsupportedAlterIndexStmt(AlterTableStmt *alterTableStatement);
extern void MarkIndexValid(IndexStmt *indexStmt);
extern List *ExecuteFunctionOnEachTableIndex(Oid relationId, PGIndexProcessor pgIndexProcessor, int flags);
extern List * ExecuteFunctionOnEachTableIndex(Oid relationId, PGIndexProcessor
pgIndexProcessor, int flags);
extern bool IsReindexWithParam_compat(ReindexStmt *stmt, char *paramName);
/* objectaddress.c - forward declarations */
extern List *CreateExtensionStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List * CreateExtensionStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
/* owned.c - forward declarations */
extern List *PreprocessDropOwnedStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessDropOwnedStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
/* policy.c - forward declarations */
extern List *CreatePolicyCommands(Oid relationId);
extern List * CreatePolicyCommands(Oid relationId);
extern void ErrorIfUnsupportedPolicy(Relation relation);
extern void ErrorIfUnsupportedPolicyExpr(Node *expr);
extern List *PostprocessCreatePolicyStmt(Node *node, const char *queryString);
extern List *PreprocessAlterPolicyStmt(Node *node, const char *queryString,
extern List * PostprocessCreatePolicyStmt(Node *node, const char *queryString);
extern List * PreprocessAlterPolicyStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessDropPolicyStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessDropPolicyStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern bool IsPolicyRenameStmt(RenameStmt *stmt);
extern void CreatePolicyEventExtendNames(CreatePolicyStmt *stmt, const char *schemaName,
uint64 shardId);
extern void AlterPolicyEventExtendNames(AlterPolicyStmt *stmt, const char *schemaName,
uint64 shardId);
extern void RenamePolicyEventExtendNames(RenameStmt *stmt, const char *schemaName, uint64 shardId);
extern void DropPolicyEventExtendNames(DropStmt *stmt, const char *schemaName, uint64 shardId);
extern void RenamePolicyEventExtendNames(RenameStmt *stmt, const char *schemaName, uint64
shardId);
extern void DropPolicyEventExtendNames(DropStmt *stmt, const char *schemaName, uint64
shardId);
extern void AddRangeTableEntryToQueryCompat(ParseState *parseState, Relation relation);
/* publication.c - forward declarations */
extern List *PostProcessCreatePublicationStmt(Node *node, const char *queryString);
extern List *CreatePublicationDDLCommandsIdempotent(const ObjectAddress *address);
extern char *CreatePublicationDDLCommand(Oid publicationId);
extern List *PreprocessAlterPublicationStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityCtx);
extern List *GetAlterPublicationDDLCommandsForTable(Oid relationId, bool isAdd);
extern char *GetAlterPublicationTableDDLCommand(Oid publicationId, Oid relationId,
bool isAdd);
extern List *AlterPublicationOwnerStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List *AlterPublicationStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List *CreatePublicationStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List *RenamePublicationStmtObjectAddress(Node *node, bool missingOk,
extern List * PostProcessCreatePublicationStmt(Node *node, const char *queryString);
extern List * CreatePublicationDDLCommandsIdempotent(const ObjectAddress *address);
extern char * CreatePublicationDDLCommand(Oid publicationId);
extern List * PreprocessAlterPublicationStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityCtx);
extern List * GetAlterPublicationDDLCommandsForTable(Oid relationId, bool isAdd);
extern char * GetAlterPublicationTableDDLCommand(Oid publicationId, Oid relationId,
bool isAdd);
extern List * AlterPublicationOwnerStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List * AlterPublicationStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List * CreatePublicationStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
extern List * RenamePublicationStmtObjectAddress(Node *node, bool missingOk,
bool isPostProcess);
/* rename.c - forward declarations*/
extern List *PreprocessRenameStmt(Node *renameStmt, const char *renameCommand,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessRenameStmt(Node *renameStmt, const char *renameCommand,
ProcessUtilityContext processUtilityContext);
extern void ErrorIfUnsupportedRenameStmt(RenameStmt *renameStmt);
extern List *PreprocessRenameAttributeStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessRenameAttributeStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
/* role.c - forward declarations*/
extern List *PostprocessAlterRoleStmt(Node *stmt, const char *queryString);
extern List *PreprocessAlterRoleSetStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessAlterRoleStmt(Node *stmt, const char *queryString);
extern List * PreprocessAlterRoleSetStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterRoleRenameStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *GenerateAlterRoleSetCommandForRole(Oid roleid);
extern List *AlterRoleStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterRoleSetStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *PreprocessCreateRoleStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessDropRoleStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessGrantRoleStmt(Node *stmt, const char *queryString,
extern List * GenerateAlterRoleSetCommandForRole(Oid roleid);
extern List * AlterRoleStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List * AlterRoleSetStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List * PreprocessCreateRoleStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessDropRoleStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessGrantRoleStmt(Node *stmt, const char *queryString);
extern List *GenerateCreateOrAlterRoleCommand(Oid roleOid);
extern List *CreateRoleStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List * PreprocessGrantRoleStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessGrantRoleStmt(Node *stmt, const char *queryString);
extern List * GenerateCreateOrAlterRoleCommand(Oid roleOid);
extern List * CreateRoleStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * RenameRoleStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern void UnmarkRolesDistributed(List *roles);
extern List *FilterDistributedRoles(List *roles);
extern List * FilterDistributedRoles(List *roles);
/* schema.c - forward declarations */
extern List *PostprocessCreateSchemaStmt(Node *node, const char *queryString);
extern List *PreprocessDropSchemaStmt(Node *dropSchemaStatement,
const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterObjectSchemaStmt(Node *alterObjectSchemaStmt,
const char *alterObjectSchemaCommand);
extern List *PreprocessGrantOnSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *CreateSchemaStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterSchemaOwnerStmtObjectAddress(Node *node, bool missing_ok,
bool isPostprocess);
extern List *AlterSchemaRenameStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PostprocessCreateSchemaStmt(Node *node, const char *queryString);
extern List * PreprocessDropSchemaStmt(Node *dropSchemaStatement,
const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterObjectSchemaStmt(Node *alterObjectSchemaStmt,
const char *alterObjectSchemaCommand);
extern List * PreprocessGrantOnSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * CreateSchemaStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterSchemaOwnerStmtObjectAddress(Node *node, bool missing_ok,
bool isPostprocess);
extern List * AlterSchemaRenameStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
/* sequence.c - forward declarations */
extern List *PreprocessAlterSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterSequenceSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PostprocessAlterSequenceSchemaStmt(Node *node, const char *queryString);
extern List *PreprocessAlterSequenceOwnerStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessAlterSequenceOwnerStmt(Node *node, const char *queryString);
#if (PG_VERSION_NUM >= PG_VERSION_15)
extern List *PreprocessAlterSequencePersistenceStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PreprocessSequenceAlterTableStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
#endif
extern List *PreprocessDropSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *SequenceDropStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *PreprocessRenameSequenceStmt(Node *node, const char *queryString,
extern List * PreprocessAlterSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessGrantOnSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessGrantOnSequenceStmt(Node *node, const char *queryString);
extern List *AlterSequenceStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterSequenceSchemaStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterSequenceOwnerStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PreprocessAlterSequenceSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterSequenceSchemaStmt(Node *node, const char *queryString);
extern List * PreprocessAlterSequenceOwnerStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessAlterSequenceOwnerStmt(Node *node, const char *queryString);
#if (PG_VERSION_NUM >= PG_VERSION_15)
extern List *AlterSequencePersistenceStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PreprocessAlterSequencePersistenceStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PreprocessSequenceAlterTableStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
#endif
extern List *RenameSequenceStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PreprocessDropSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * SequenceDropStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * PreprocessRenameSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessGrantOnSequenceStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessGrantOnSequenceStmt(Node *node, const char *queryString);
extern List * AlterSequenceStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterSequenceSchemaStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * AlterSequenceOwnerStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
#if (PG_VERSION_NUM >= PG_VERSION_15)
extern List * AlterSequencePersistenceStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
#endif
extern List * RenameSequenceStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern void ErrorIfUnsupportedSeqStmt(CreateSeqStmt *createSeqStmt);
extern void ErrorIfDistributedAlterSeqOwnedBy(AlterSeqStmt *alterSeqStmt);
extern char *GenerateBackupNameForSequenceCollision(const ObjectAddress *address);
extern char * GenerateBackupNameForSequenceCollision(const ObjectAddress *address);
extern void RenameExistingSequenceWithDifferentTypeIfExists(RangeVar *sequence,
Oid desiredSeqTypeId);
/* statistics.c - forward declarations */
extern List *PreprocessCreateStatisticsStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessCreateStatisticsStmt(Node *node, const char *queryString);
extern List *CreateStatisticsStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess);
extern List *PreprocessDropStatisticsStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *DropStatisticsObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *PreprocessAlterStatisticsRenameStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PreprocessAlterStatisticsSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PostprocessAlterStatisticsSchemaStmt(Node *node, const char *queryString);
extern List *AlterStatisticsSchemaStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess);
extern List *PreprocessAlterStatisticsStmt(Node *node, const char *queryString,
extern List * PreprocessCreateStatisticsStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessCreateStatisticsStmt(Node *node, const char *queryString);
extern List * CreateStatisticsStmtObjectAddress(Node *node, bool missingOk, bool
isPostprocess);
extern List * PreprocessDropStatisticsStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterStatisticsOwnerStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List *PostprocessAlterStatisticsOwnerStmt(Node *node, const char *queryString);
extern List *GetExplicitStatisticsCommandList(Oid relationId);
extern List *GetExplicitStatisticsSchemaIdList(Oid relationId);
extern List *GetAlterIndexStatisticsCommands(Oid indexOid);
extern List * DropStatisticsObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * PreprocessAlterStatisticsRenameStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PreprocessAlterStatisticsSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterStatisticsSchemaStmt(Node *node, const char *queryString);
extern List * AlterStatisticsSchemaStmtObjectAddress(Node *node, bool missingOk, bool
isPostprocess);
extern List * PreprocessAlterStatisticsStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterStatisticsOwnerStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterStatisticsOwnerStmt(Node *node, const char *queryString);
extern List * GetExplicitStatisticsCommandList(Oid relationId);
extern List * GetExplicitStatisticsSchemaIdList(Oid relationId);
extern List * GetAlterIndexStatisticsCommands(Oid indexOid);
/* subscription.c - forward declarations */
extern Node *ProcessCreateSubscriptionStmt(CreateSubscriptionStmt *createSubStmt);
extern Node * ProcessCreateSubscriptionStmt(CreateSubscriptionStmt *createSubStmt);
/* table.c - forward declarations */
extern List *PreprocessDropTableStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessDropTableStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern void PostprocessCreateTableStmt(CreateStmt *createStatement,
const char *queryString);
extern bool ShouldEnableLocalReferenceForeignKeys(void);
extern List *PreprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement,
const char *queryString);
extern List *PostprocessAlterTableSchemaStmt(Node *node, const char *queryString);
extern List * PreprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement,
const char *queryString);
extern List * PostprocessAlterTableSchemaStmt(Node *node, const char *queryString);
extern void PrepareAlterTableStmtForConstraint(AlterTableStmt *alterTableStatement,
Oid relationId, Constraint *constraint);
extern List *PreprocessAlterTableStmt(Node *node, const char *alterTableCommand,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString,
extern List * PreprocessAlterTableStmt(Node *node, const char *alterTableCommand,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessAlterTableSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PreprocessAlterTableSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern void SkipForeignKeyValidationIfConstraintIsFkey(AlterTableStmt *alterTableStmt,
bool processLocalRelation);
extern bool IsAlterTableRenameStmt(RenameStmt *renameStmt);
@ -582,144 +613,160 @@ extern void ErrorUnsupportedAlterTableAddColumn(Oid relationId, AlterTableCmd *c
extern void ErrorIfUnsupportedConstraint(Relation relation, char distributionMethod,
char referencingReplicationModel,
Var *distributionColumn, uint32 colocationId);
extern List *InterShardDDLTaskList(Oid leftRelationId, Oid rightRelationId,
const char *commandString);
extern List *AlterTableSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *MakeNameListFromRangeVar(const RangeVar *rel);
extern List * InterShardDDLTaskList(Oid leftRelationId, Oid rightRelationId,
const char *commandString);
extern List * AlterTableSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * MakeNameListFromRangeVar(const RangeVar *rel);
extern Oid GetSequenceOid(Oid relationId, AttrNumber attnum);
extern bool ConstrTypeUsesIndex(ConstrType constrType);
extern bool ConstrTypeCitusCanDefaultName(ConstrType constrType);
extern char *GetAlterColumnWithNextvalDefaultCmd(Oid sequenceOid, Oid relationId,
char *colname, bool missingTableOk);
extern char * GetAlterColumnWithNextvalDefaultCmd(Oid sequenceOid, Oid relationId,
char *colname, bool missingTableOk);
extern void ErrorIfTableHasIdentityColumn(Oid relationId);
extern void ConvertNewTableIfNecessary(Node *createStmt);
extern void ConvertToTenantTableIfNecessary(AlterObjectSchemaStmt *alterObjectSchemaStmt);
/* text_search.c - forward declarations */
extern List *GetCreateTextSearchConfigStatements(const ObjectAddress *address);
extern List *GetCreateTextSearchDictionaryStatements(const ObjectAddress *address);
extern List *CreateTextSearchConfigDDLCommandsIdempotent(const ObjectAddress *address);
extern List *CreateTextSearchDictDDLCommandsIdempotent(const ObjectAddress *address);
extern List *CreateTextSearchConfigurationObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *CreateTextSearchDictObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *RenameTextSearchConfigurationStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *RenameTextSearchDictionaryStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchConfigurationStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchDictionaryStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchConfigurationSchemaStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchDictionarySchemaStmtObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *TextSearchConfigurationCommentObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *TextSearchDictCommentObjectAddress(Node *node,
extern List * GetCreateTextSearchConfigStatements(const ObjectAddress *address);
extern List * GetCreateTextSearchDictionaryStatements(const ObjectAddress *address);
extern List * CreateTextSearchConfigDDLCommandsIdempotent(const ObjectAddress *address);
extern List * CreateTextSearchDictDDLCommandsIdempotent(const ObjectAddress *address);
extern List * CreateTextSearchConfigurationObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * CreateTextSearchDictObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchConfigurationOwnerObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List *AlterTextSearchDictOwnerObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern char *GenerateBackupNameForTextSearchConfiguration(const ObjectAddress *address);
extern char *GenerateBackupNameForTextSearchDict(const ObjectAddress *address);
extern List *get_ts_config_namelist(Oid tsconfigOid);
extern List * RenameTextSearchConfigurationStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * RenameTextSearchDictionaryStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterTextSearchConfigurationStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterTextSearchDictionaryStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterTextSearchConfigurationSchemaStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterTextSearchDictionarySchemaStmtObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * TextSearchConfigurationCommentObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * TextSearchDictCommentObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern List * AlterTextSearchConfigurationOwnerObjectAddress(Node *node,
bool missing_ok, bool
isPostprocess);
extern List * AlterTextSearchDictOwnerObjectAddress(Node *node,
bool missing_ok, bool isPostprocess);
extern char * GenerateBackupNameForTextSearchConfiguration(const ObjectAddress *address);
extern char * GenerateBackupNameForTextSearchDict(const ObjectAddress *address);
extern List * get_ts_config_namelist(Oid tsconfigOid);
/* truncate.c - forward declarations */
extern void PreprocessTruncateStatement(TruncateStmt *truncateStatement);
/* type.c - forward declarations */
extern List *PreprocessRenameTypeAttributeStmt(Node *stmt, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern Node *CreateTypeStmtByObjectAddress(const ObjectAddress *address);
extern List *CompositeTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *CreateEnumStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *AlterTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *AlterEnumStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *RenameTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *AlterTypeSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List *RenameTypeAttributeStmtObjectAddress(Node *stmt,
bool missing_ok);
extern List *AlterTypeOwnerObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List *CreateTypeDDLCommandsIdempotent(const ObjectAddress *typeAddress);
extern char *GenerateBackupNameForTypeCollision(const ObjectAddress *address);
extern List * PreprocessRenameTypeAttributeStmt(Node *stmt, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern Node * CreateTypeStmtByObjectAddress(const ObjectAddress *address);
extern List * CompositeTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * CreateEnumStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * AlterTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List * AlterEnumStmtObjectAddress(Node *stmt, bool missing_ok, bool isPostprocess);
extern List * RenameTypeStmtObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * AlterTypeSchemaStmtObjectAddress(Node *stmt,
bool missing_ok, bool isPostprocess);
extern List * RenameTypeAttributeStmtObjectAddress(Node *stmt,
bool missing_ok);
extern List * AlterTypeOwnerObjectAddress(Node *stmt, bool missing_ok, bool
isPostprocess);
extern List * CreateTypeDDLCommandsIdempotent(const ObjectAddress *typeAddress);
extern char * GenerateBackupNameForTypeCollision(const ObjectAddress *address);
/* function.c - forward declarations */
extern List *CreateFunctionDDLCommandsIdempotent(const ObjectAddress *functionAddress);
extern char *GetFunctionDDLCommand(const RegProcedure funcOid, bool useCreateOrReplace);
extern char *GenerateBackupNameForProcCollision(const ObjectAddress *address);
extern ObjectWithArgs *ObjectWithArgsFromOid(Oid funcOid);
extern List * CreateFunctionDDLCommandsIdempotent(const ObjectAddress *functionAddress);
extern char * GetFunctionDDLCommand(const RegProcedure funcOid, bool useCreateOrReplace);
extern char * GenerateBackupNameForProcCollision(const ObjectAddress *address);
extern ObjectWithArgs * ObjectWithArgsFromOid(Oid funcOid);
extern void UpdateFunctionDistributionInfo(const ObjectAddress *distAddress,
int *distribution_argument_index,
int *colocationId,
bool *forceDelegation);
/* vacuum.c - forward declarations */
extern List *PostprocessVacuumStmt(Node *node, const char *vacuumCommand);
extern List * PostprocessVacuumStmt(Node *node, const char *vacuumCommand);
/* view.c - forward declarations */
extern List *PreprocessViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessViewStmt(Node *node, const char *queryString);
extern List *ViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *AlterViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *PreprocessDropViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *DropViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern char *CreateViewDDLCommand(Oid viewOid);
extern List *GetViewCreationCommandsOfTable(Oid relationId);
extern char *AlterViewOwnerCommand(Oid viewOid);
extern char *DeparseViewStmt(Node *node);
extern char *DeparseDropViewStmt(Node *node);
extern bool IsViewDistributed(Oid viewOid);
extern List *CreateViewDDLCommandsIdempotent(Oid viewOid);
extern List *PreprocessAlterViewStmt(Node *node, const char *queryString,
extern List * PreprocessViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessViewStmt(Node *node, const char *queryString);
extern List * ViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * AlterViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PreprocessDropViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessAlterViewStmt(Node *node, const char *queryString);
extern List *PreprocessRenameViewStmt(Node *node, const char *queryString,
extern List * DropViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern char * CreateViewDDLCommand(Oid viewOid);
extern List * GetViewCreationCommandsOfTable(Oid relationId);
extern char * AlterViewOwnerCommand(Oid viewOid);
extern char * DeparseViewStmt(Node *node);
extern char * DeparseDropViewStmt(Node *node);
extern bool IsViewDistributed(Oid viewOid);
extern List * CreateViewDDLCommandsIdempotent(Oid viewOid);
extern List * PreprocessAlterViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *RenameViewStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List *PreprocessAlterViewSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessAlterViewSchemaStmt(Node *node, const char *queryString);
extern List *AlterViewSchemaStmtObjectAddress(Node *node, bool missing_ok, bool isPostprocess);
extern List * PostprocessAlterViewStmt(Node *node, const char *queryString);
extern List * PreprocessRenameViewStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * RenameViewStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern List * PreprocessAlterViewSchemaStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessAlterViewSchemaStmt(Node *node, const char *queryString);
extern List * AlterViewSchemaStmtObjectAddress(Node *node, bool missing_ok, bool
isPostprocess);
extern bool IsViewRenameStmt(RenameStmt *renameStmt);
/* trigger.c - forward declarations */
extern List *GetExplicitTriggerCommandList(Oid relationId);
extern List * GetExplicitTriggerCommandList(Oid relationId);
extern HeapTuple GetTriggerTupleById(Oid triggerId, bool missingOk);
extern List *GetExplicitTriggerIdList(Oid relationId);
extern List *PostprocessCreateTriggerStmt(Node *node, const char *queryString);
extern List *CreateTriggerStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess);
extern List * GetExplicitTriggerIdList(Oid relationId);
extern List * PostprocessCreateTriggerStmt(Node *node, const char *queryString);
extern List * CreateTriggerStmtObjectAddress(Node *node, bool missingOk, bool
isPostprocess);
extern void CreateTriggerEventExtendNames(CreateTrigStmt *createTriggerStmt,
char *schemaName, uint64 shardId);
extern List *PreprocessAlterTriggerRenameStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List *PostprocessAlterTriggerRenameStmt(Node *node, const char *queryString);
extern List * PreprocessAlterTriggerRenameStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PostprocessAlterTriggerRenameStmt(Node *node, const char *queryString);
extern void AlterTriggerRenameEventExtendNames(RenameStmt *renameTriggerStmt,
char *schemaName, uint64 shardId);
extern List *PostprocessAlterTriggerDependsStmt(Node *node, const char *queryString);
extern List *PreprocessAlterTriggerDependsStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern List * PostprocessAlterTriggerDependsStmt(Node *node, const char *queryString);
extern List * PreprocessAlterTriggerDependsStmt(Node *node, const char *queryString,
ProcessUtilityContext
processUtilityContext);
extern void AlterTriggerDependsEventExtendNames(
AlterObjectDependsStmt *alterTriggerDependsStmt,
char *schemaName, uint64 shardId);
extern void ErrorOutForTriggerIfNotSupported(Oid relationId);
extern void ErrorIfRelationHasUnsupportedTrigger(Oid relationId);
extern List *PreprocessDropTriggerStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern List * PreprocessDropTriggerStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext);
extern void DropTriggerEventExtendNames(DropStmt *dropTriggerStmt, char *schemaName,
uint64 shardId);
extern List *CitusCreateTriggerCommandDDLJob(Oid relationId, char *triggerName,
const char *queryString);
extern List * CitusCreateTriggerCommandDDLJob(Oid relationId, char *triggerName,
const char *queryString);
extern Oid GetTriggerFunctionId(Oid triggerId);
/* cascade_table_operation_for_connected_relations.c */
@ -746,12 +793,12 @@ typedef enum CascadeOperationType
extern void CascadeOperationForFkeyConnectedRelations(Oid relationId,
LOCKMODE relLockMode,
CascadeOperationType
cascadeOperationType);
cascadeOperationType);
extern void CascadeOperationForRelationIdList(List *relationIdList, LOCKMODE lockMode,
CascadeOperationType cascadeOperationType);
extern void ErrorIfAnyPartitionRelationInvolvedInNonInheritedFKey(List *relationIdList);
extern bool RelationIdListHasReferenceTable(List *relationIdList);
extern List *GetFKeyCreationCommandsForRelationIdList(List *relationIdList);
extern List * GetFKeyCreationCommandsForRelationIdList(List *relationIdList);
extern void DropRelationForeignKeys(Oid relationId, int flags);
extern void SetLocalEnableLocalReferenceForeignKeys(bool state);
extern void ExecuteAndLogUtilityCommandListInTableTypeConversionViaSPI(
@ -765,7 +812,7 @@ extern void ExecuteForeignKeyCreateCommandList(List *ddlCommandList,
extern void CreateCitusLocalTable(Oid relationId, bool cascadeViaForeignKeys,
bool autoConverted);
extern bool ShouldAddNewTableToMetadata(Oid relationId);
extern List *GetExplicitIndexOidList(Oid relationId);
extern List * GetExplicitIndexOidList(Oid relationId);
extern bool ShouldPropagateSetCommand(VariableSetStmt *setStmt);
extern void PostprocessVariableSetStmt(VariableSetStmt *setStmt, const char *setCommand);
@ -773,7 +820,7 @@ extern void PostprocessVariableSetStmt(VariableSetStmt *setStmt, const char *set
extern void CreateCitusLocalTablePartitionOf(CreateStmt *createStatement,
Oid relationId, Oid parentRelationId);
extern void UpdateAutoConvertedForConnectedRelations(List *relationId, bool
autoConverted);
autoConverted);
/* schema_based_sharding.c */
extern bool ShouldUseSchemaBasedSharding(char *schemaName);

View File

@ -231,7 +231,6 @@ extern char * DeparseCreateDatabaseStmt(Node *node);
extern char * DeparseDropDatabaseStmt(Node *node);
/* forward declaration for deparse_publication_stmts.c */
extern char * DeparseCreatePublicationStmt(Node *stmt);
extern char * DeparseCreatePublicationStmtExtended(Node *node,