83 const char *queryString,
392 elog(
ERROR,
"unrecognized TransactionStmtKind: %d",
398 elog(
ERROR,
"unrecognized node type: %d",
415 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
417 errmsg(
"cannot execute %s in a read-only transaction",
433 (
errcode(ERRCODE_INVALID_TRANSACTION_STATE),
435 errmsg(
"cannot execute %s during a parallel operation",
452 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
454 errmsg(
"cannot execute %s during recovery",
470 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
472 errmsg(
"cannot execute %s within security-restricted operation",
507 const char *queryString,
517 Assert(queryString != NULL);
526 (*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,
527 context, params, queryEnv,
531 context, params, queryEnv,
548 const char *queryString,
621 if (strcmp(item->
defname,
"transaction_isolation") == 0)
625 else if (strcmp(item->
defname,
"transaction_read_only") == 0)
629 else if (strcmp(item->
defname,
"transaction_deferrable") == 0)
826 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
828 errmsg(
"cannot execute %s within a background process",
952 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
953 errmsg(
"must be superuser or have privileges of pg_checkpointer to do CHECKPOINT")));
974 context, params, queryEnv,
987 context, params, queryEnv,
1000 context, params, queryEnv,
1013 context, params, queryEnv,
1026 context, params, queryEnv,
1039 context, params, queryEnv,
1052 context, params, queryEnv,
1065 context, params, queryEnv,
1075 context, params, queryEnv,
1098 const char *queryString,
1109 bool commandCollected =
false;
1119 if (isCompleteQuery)
1137 commandCollected =
true;
1155 while (stmts !=
NIL)
1164 Datum toast_options;
1211 RELKIND_FOREIGN_TABLE,
1231 Assert(table_rv != NULL);
1271 commandCollected =
true;
1287 foreach(cell, atstmt->
cmds)
1296 "ALTER TABLE ... DETACH CONCURRENTLY");
1314 atcontext.
pstmt = pstmt;
1316 atcontext.
relid = relid;
1317 atcontext.
params = params;
1332 (
errmsg(
"relation \"%s\" does not exist, skipping",
1337 commandCollected =
true;
1389 elog(
ERROR,
"unrecognized alter domain type: %d",
1452 elog(
ERROR,
"unrecognized define stmt type: %d",
1464 bool is_alter_table;
1468 "CREATE INDEX CONCURRENTLY");
1503 foreach(lc, inheritors)
1507 if (relkind != RELKIND_RELATION &&
1508 relkind != RELKIND_MATVIEW &&
1509 relkind != RELKIND_PARTITIONED_TABLE &&
1510 relkind != RELKIND_FOREIGN_TABLE)
1511 elog(
ERROR,
"unexpected relkind \"%c\" on partition \"%s\"",
1514 if (relkind == RELKIND_FOREIGN_TABLE &&
1517 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1518 errmsg(
"cannot create unique index on partitioned table \"%s\"",
1520 errdetail(
"Table \"%s\" contains partitions that are foreign tables.",
1561 commandCollected =
true;
1606 commandCollected =
true;
1612 commandCollected =
true;
1643 commandCollected =
true;
1669 params, queryEnv, qc);
1684 queryString, params, qc);
1719 commandCollected =
true;
1729 commandCollected =
true;
1739 commandCollected =
true;
1754 commandCollected =
true;
1760 commandCollected =
true;
1766 commandCollected =
true;
1804 commandCollected =
true;
1810 commandCollected =
true;
1816 commandCollected =
true;
1846 commandCollected =
true;
1864 commandCollected =
true;
1875 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1876 errmsg(
"only a single relation is allowed in CREATE STATISTICS")));
1907 elog(
ERROR,
"unrecognized node type: %d",
1916 if (!commandCollected)
1920 if (isCompleteQuery)
1992 "DROP INDEX CONCURRENTLY");
2127 QueryReturnsTuples(
Query *parsetree)
2214 tag = CMDTAG_ALTER_AGGREGATE;
2217 tag = CMDTAG_ALTER_TYPE;
2220 tag = CMDTAG_ALTER_CAST;
2223 tag = CMDTAG_ALTER_COLLATION;
2226 tag = CMDTAG_ALTER_TABLE;
2229 tag = CMDTAG_ALTER_CONVERSION;
2232 tag = CMDTAG_ALTER_DATABASE;
2236 tag = CMDTAG_ALTER_DOMAIN;
2239 tag = CMDTAG_ALTER_EXTENSION;
2242 tag = CMDTAG_ALTER_FOREIGN_DATA_WRAPPER;
2245 tag = CMDTAG_ALTER_SERVER;
2248 tag = CMDTAG_ALTER_FOREIGN_TABLE;
2251 tag = CMDTAG_ALTER_FUNCTION;
2254 tag = CMDTAG_ALTER_INDEX;
2257 tag = CMDTAG_ALTER_LANGUAGE;
2260 tag = CMDTAG_ALTER_LARGE_OBJECT;
2263 tag = CMDTAG_ALTER_OPERATOR_CLASS;
2266 tag = CMDTAG_ALTER_OPERATOR;
2269 tag = CMDTAG_ALTER_OPERATOR_FAMILY;
2272 tag = CMDTAG_ALTER_POLICY;
2275 tag = CMDTAG_ALTER_PROCEDURE;
2278 tag = CMDTAG_ALTER_ROLE;
2281 tag = CMDTAG_ALTER_ROUTINE;
2284 tag = CMDTAG_ALTER_RULE;
2287 tag = CMDTAG_ALTER_SCHEMA;
2290 tag = CMDTAG_ALTER_SEQUENCE;
2294 tag = CMDTAG_ALTER_TABLE;
2297 tag = CMDTAG_ALTER_TABLESPACE;
2300 tag = CMDTAG_ALTER_TRIGGER;
2303 tag = CMDTAG_ALTER_EVENT_TRIGGER;
2306 tag = CMDTAG_ALTER_TEXT_SEARCH_CONFIGURATION;
2309 tag = CMDTAG_ALTER_TEXT_SEARCH_DICTIONARY;
2312 tag = CMDTAG_ALTER_TEXT_SEARCH_PARSER;
2315 tag = CMDTAG_ALTER_TEXT_SEARCH_TEMPLATE;
2318 tag = CMDTAG_ALTER_TYPE;
2321 tag = CMDTAG_ALTER_VIEW;
2324 tag = CMDTAG_ALTER_MATERIALIZED_VIEW;
2327 tag = CMDTAG_ALTER_PUBLICATION;
2330 tag = CMDTAG_ALTER_SUBSCRIPTION;
2333 tag = CMDTAG_ALTER_STATISTICS;
2336 tag = CMDTAG_UNKNOWN;
2366 tag = CMDTAG_INSERT;
2370 tag = CMDTAG_DELETE;
2374 tag = CMDTAG_UPDATE;
2382 tag = CMDTAG_SELECT;
2386 tag = CMDTAG_SELECT;
2401 tag = CMDTAG_START_TRANSACTION;
2405 tag = CMDTAG_COMMIT;
2410 tag = CMDTAG_ROLLBACK;
2414 tag = CMDTAG_SAVEPOINT;
2418 tag = CMDTAG_RELEASE;
2422 tag = CMDTAG_PREPARE_TRANSACTION;
2426 tag = CMDTAG_COMMIT_PREPARED;
2430 tag = CMDTAG_ROLLBACK_PREPARED;
2434 tag = CMDTAG_UNKNOWN;
2441 tag = CMDTAG_DECLARE_CURSOR;
2449 tag = CMDTAG_CLOSE_CURSOR_ALL;
2451 tag = CMDTAG_CLOSE_CURSOR;
2459 tag = (stmt->
ismove) ? CMDTAG_MOVE : CMDTAG_FETCH;
2464 tag = CMDTAG_CREATE_DOMAIN;
2468 tag = CMDTAG_CREATE_SCHEMA;
2472 tag = CMDTAG_CREATE_TABLE;
2476 tag = CMDTAG_CREATE_TABLESPACE;
2480 tag = CMDTAG_DROP_TABLESPACE;
2484 tag = CMDTAG_ALTER_TABLESPACE;
2488 tag = CMDTAG_CREATE_EXTENSION;
2492 tag = CMDTAG_ALTER_EXTENSION;
2496 tag = CMDTAG_ALTER_EXTENSION;
2500 tag = CMDTAG_CREATE_FOREIGN_DATA_WRAPPER;
2504 tag = CMDTAG_ALTER_FOREIGN_DATA_WRAPPER;
2508 tag = CMDTAG_CREATE_SERVER;
2512 tag = CMDTAG_ALTER_SERVER;
2516 tag = CMDTAG_CREATE_USER_MAPPING;
2520 tag = CMDTAG_ALTER_USER_MAPPING;
2524 tag = CMDTAG_DROP_USER_MAPPING;
2528 tag = CMDTAG_CREATE_FOREIGN_TABLE;
2532 tag = CMDTAG_IMPORT_FOREIGN_SCHEMA;
2536 switch (((
DropStmt *) parsetree)->removeType)
2539 tag = CMDTAG_DROP_TABLE;
2542 tag = CMDTAG_DROP_SEQUENCE;
2545 tag = CMDTAG_DROP_VIEW;
2548 tag = CMDTAG_DROP_MATERIALIZED_VIEW;
2551 tag = CMDTAG_DROP_INDEX;
2554 tag = CMDTAG_DROP_TYPE;
2557 tag = CMDTAG_DROP_DOMAIN;
2560 tag = CMDTAG_DROP_COLLATION;
2563 tag = CMDTAG_DROP_CONVERSION;
2566 tag = CMDTAG_DROP_SCHEMA;
2569 tag = CMDTAG_DROP_TEXT_SEARCH_PARSER;
2572 tag = CMDTAG_DROP_TEXT_SEARCH_DICTIONARY;
2575 tag = CMDTAG_DROP_TEXT_SEARCH_TEMPLATE;
2578 tag = CMDTAG_DROP_TEXT_SEARCH_CONFIGURATION;
2581 tag = CMDTAG_DROP_FOREIGN_TABLE;
2584 tag = CMDTAG_DROP_EXTENSION;
2587 tag = CMDTAG_DROP_FUNCTION;
2590 tag = CMDTAG_DROP_PROCEDURE;
2593 tag = CMDTAG_DROP_ROUTINE;
2596 tag = CMDTAG_DROP_AGGREGATE;
2599 tag = CMDTAG_DROP_OPERATOR;
2602 tag = CMDTAG_DROP_LANGUAGE;
2605 tag = CMDTAG_DROP_CAST;
2608 tag = CMDTAG_DROP_TRIGGER;
2611 tag = CMDTAG_DROP_EVENT_TRIGGER;
2614 tag = CMDTAG_DROP_RULE;
2617 tag = CMDTAG_DROP_FOREIGN_DATA_WRAPPER;
2620 tag = CMDTAG_DROP_SERVER;
2623 tag = CMDTAG_DROP_OPERATOR_CLASS;
2626 tag = CMDTAG_DROP_OPERATOR_FAMILY;
2629 tag = CMDTAG_DROP_POLICY;
2632 tag = CMDTAG_DROP_TRANSFORM;
2635 tag = CMDTAG_DROP_ACCESS_METHOD;
2638 tag = CMDTAG_DROP_PUBLICATION;
2641 tag = CMDTAG_DROP_STATISTICS;
2644 tag = CMDTAG_UNKNOWN;
2649 tag = CMDTAG_TRUNCATE_TABLE;
2653 tag = CMDTAG_COMMENT;
2657 tag = CMDTAG_SECURITY_LABEL;
2696 tag = CMDTAG_ALTER_DOMAIN;
2703 tag = CMDTAG_ALTER_FUNCTION;
2706 tag = CMDTAG_ALTER_PROCEDURE;
2709 tag = CMDTAG_ALTER_ROUTINE;
2712 tag = CMDTAG_UNKNOWN;
2720 tag = (stmt->
is_grant) ? CMDTAG_GRANT : CMDTAG_REVOKE;
2728 tag = (stmt->
is_grant) ? CMDTAG_GRANT_ROLE : CMDTAG_REVOKE_ROLE;
2733 tag = CMDTAG_ALTER_DEFAULT_PRIVILEGES;
2740 tag = CMDTAG_CREATE_AGGREGATE;
2743 tag = CMDTAG_CREATE_OPERATOR;
2746 tag = CMDTAG_CREATE_TYPE;
2749 tag = CMDTAG_CREATE_TEXT_SEARCH_PARSER;
2752 tag = CMDTAG_CREATE_TEXT_SEARCH_DICTIONARY;
2755 tag = CMDTAG_CREATE_TEXT_SEARCH_TEMPLATE;
2758 tag = CMDTAG_CREATE_TEXT_SEARCH_CONFIGURATION;
2761 tag = CMDTAG_CREATE_COLLATION;
2764 tag = CMDTAG_CREATE_ACCESS_METHOD;
2767 tag = CMDTAG_UNKNOWN;
2772 tag = CMDTAG_CREATE_TYPE;
2776 tag = CMDTAG_CREATE_TYPE;
2780 tag = CMDTAG_CREATE_TYPE;
2784 tag = CMDTAG_ALTER_TYPE;
2788 tag = CMDTAG_CREATE_VIEW;
2793 tag = CMDTAG_CREATE_PROCEDURE;
2795 tag = CMDTAG_CREATE_FUNCTION;
2799 tag = CMDTAG_CREATE_INDEX;
2803 tag = CMDTAG_CREATE_RULE;
2807 tag = CMDTAG_CREATE_SEQUENCE;
2811 tag = CMDTAG_ALTER_SEQUENCE;
2819 tag = CMDTAG_CREATE_DATABASE;
2825 tag = CMDTAG_ALTER_DATABASE;
2829 tag = CMDTAG_DROP_DATABASE;
2833 tag = CMDTAG_NOTIFY;
2837 tag = CMDTAG_LISTEN;
2841 tag = CMDTAG_UNLISTEN;
2853 tag = CMDTAG_CLUSTER;
2857 if (((
VacuumStmt *) parsetree)->is_vacuumcmd)
2858 tag = CMDTAG_VACUUM;
2860 tag = CMDTAG_ANALYZE;
2864 tag = CMDTAG_EXPLAIN;
2872 tag = CMDTAG_SELECT_INTO;
2874 tag = CMDTAG_CREATE_TABLE_AS;
2877 tag = CMDTAG_CREATE_MATERIALIZED_VIEW;
2880 tag = CMDTAG_UNKNOWN;
2885 tag = CMDTAG_REFRESH_MATERIALIZED_VIEW;
2889 tag = CMDTAG_ALTER_SYSTEM;
2906 tag = CMDTAG_UNKNOWN;
2918 tag = CMDTAG_DISCARD_ALL;
2921 tag = CMDTAG_DISCARD_PLANS;
2924 tag = CMDTAG_DISCARD_TEMP;
2927 tag = CMDTAG_DISCARD_SEQUENCES;
2930 tag = CMDTAG_UNKNOWN;
2935 tag = CMDTAG_CREATE_TRANSFORM;
2939 tag = CMDTAG_CREATE_TRIGGER;
2943 tag = CMDTAG_CREATE_EVENT_TRIGGER;
2947 tag = CMDTAG_ALTER_EVENT_TRIGGER;
2951 tag = CMDTAG_CREATE_LANGUAGE;
2955 tag = CMDTAG_CREATE_ROLE;
2959 tag = CMDTAG_ALTER_ROLE;
2963 tag = CMDTAG_ALTER_ROLE;
2967 tag = CMDTAG_DROP_ROLE;
2971 tag = CMDTAG_DROP_OWNED;
2975 tag = CMDTAG_REASSIGN_OWNED;
2979 tag = CMDTAG_LOCK_TABLE;
2983 tag = CMDTAG_SET_CONSTRAINTS;
2987 tag = CMDTAG_CHECKPOINT;
2991 tag = CMDTAG_REINDEX;
2995 tag = CMDTAG_CREATE_CONVERSION;
2999 tag = CMDTAG_CREATE_CAST;
3003 tag = CMDTAG_CREATE_OPERATOR_CLASS;
3007 tag = CMDTAG_CREATE_OPERATOR_FAMILY;
3011 tag = CMDTAG_ALTER_OPERATOR_FAMILY;
3015 tag = CMDTAG_ALTER_OPERATOR;
3019 tag = CMDTAG_ALTER_TYPE;
3023 tag = CMDTAG_ALTER_TEXT_SEARCH_DICTIONARY;
3027 tag = CMDTAG_ALTER_TEXT_SEARCH_CONFIGURATION;
3031 tag = CMDTAG_CREATE_POLICY;
3035 tag = CMDTAG_ALTER_POLICY;
3039 tag = CMDTAG_CREATE_ACCESS_METHOD;
3043 tag = CMDTAG_CREATE_PUBLICATION;
3047 tag = CMDTAG_ALTER_PUBLICATION;
3051 tag = CMDTAG_CREATE_SUBSCRIPTION;
3055 tag = CMDTAG_ALTER_SUBSCRIPTION;
3059 tag = CMDTAG_DROP_SUBSCRIPTION;
3063 tag = CMDTAG_ALTER_COLLATION;
3067 tag = CMDTAG_PREPARE;
3071 tag = CMDTAG_EXECUTE;
3075 tag = CMDTAG_CREATE_STATISTICS;
3079 tag = CMDTAG_ALTER_STATISTICS;
3086 if (stmt->
name == NULL)
3087 tag = CMDTAG_DEALLOCATE_ALL;
3089 tag = CMDTAG_DEALLOCATE;
3113 tag = CMDTAG_SELECT_FOR_KEY_SHARE;
3116 tag = CMDTAG_SELECT_FOR_SHARE;
3119 tag = CMDTAG_SELECT_FOR_NO_KEY_UPDATE;
3122 tag = CMDTAG_SELECT_FOR_UPDATE;
3125 tag = CMDTAG_SELECT;
3130 tag = CMDTAG_SELECT;
3133 tag = CMDTAG_UPDATE;
3136 tag = CMDTAG_INSERT;
3139 tag = CMDTAG_DELETE;
3150 tag = CMDTAG_UNKNOWN;
3176 tag = CMDTAG_SELECT_FOR_KEY_SHARE;
3179 tag = CMDTAG_SELECT_FOR_SHARE;
3182 tag = CMDTAG_SELECT_FOR_NO_KEY_UPDATE;
3185 tag = CMDTAG_SELECT_FOR_UPDATE;
3188 tag = CMDTAG_UNKNOWN;
3193 tag = CMDTAG_SELECT;
3196 tag = CMDTAG_UPDATE;
3199 tag = CMDTAG_INSERT;
3202 tag = CMDTAG_DELETE;
3213 tag = CMDTAG_UNKNOWN;
3222 tag = CMDTAG_UNKNOWN;
3336 if (((
CopyStmt *) parsetree)->is_from)
3519 if (strcmp(opt->
defname,
"analyze") == 0)
bool has_privs_of_role(Oid member, Oid role)
void ExecuteGrantStmt(GrantStmt *stmt)
void ExecAlterDefaultPrivilegesStmt(ParseState *pstate, AlterDefaultPrivilegesStmt *stmt)
ObjectAddress DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List *parameters, bool replace)
ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
ObjectAddress ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddress)
ObjectAddress ExecRenameStmt(RenameStmt *stmt)
ObjectAddress ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt, ObjectAddress *oldSchemaAddr)
ObjectAddress CreateAccessMethod(CreateAmStmt *stmt)
void Async_UnlistenAll(void)
void Async_Unlisten(const char *channel)
void Async_Listen(const char *channel)
void Async_Notify(const char *channel, const char *payload)
void DoCopy(ParseState *pstate, const CopyStmt *stmt, int stmt_location, int stmt_len, uint64 *processed)
void PrepareQuery(ParseState *pstate, PrepareStmt *stmt, int stmt_location, int stmt_len)
PreparedStatement * FetchPreparedStatement(const char *stmt_name, bool throwError)
TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt)
void ExecuteQuery(ParseState *pstate, ExecuteStmt *stmt, IntoClause *intoClause, ParamListInfo params, DestReceiver *dest, QueryCompletion *qc)
void DeallocateQuery(DeallocateStmt *stmt)
Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt)
void DropTableSpace(DropTableSpaceStmt *stmt)
Oid CreateTableSpace(CreateTableSpaceStmt *stmt)
#define OidIsValid(objectId)
void RequestCheckpoint(int flags)
void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel)
const char * GetCommandTagName(CommandTag commandTag)
static void SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag, uint64 nprocessed)
ObjectAddress AlterCollation(AlterCollationStmt *stmt)
ObjectAddress DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_exists)
ObjectAddress CreateConversionCommand(CreateConversionStmt *stmt)
ObjectAddress ExecCreateTableAs(ParseState *pstate, CreateTableAsStmt *stmt, ParamListInfo params, QueryEnvironment *queryEnv, QueryCompletion *qc)
ObjectAddress AlterDatabaseRefreshColl(AlterDatabaseRefreshCollStmt *stmt)
Oid createdb(ParseState *pstate, const CreatedbStmt *stmt)
Oid AlterDatabase(ParseState *pstate, AlterDatabaseStmt *stmt, bool isTopLevel)
void DropDatabase(ParseState *pstate, DropdbStmt *stmt)
Oid AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
bool defGetBoolean(DefElem *def)
DestReceiver * None_Receiver
void load_file(const char *filename, bool restricted)
void DiscardCommand(DiscardStmt *stmt, bool isTopLevel)
void RemoveObjects(DropStmt *stmt)
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void EventTriggerUndoInhibitCommandCollection(void)
void EventTriggerAlterTableStart(Node *parsetree)
void EventTriggerCollectAlterDefPrivs(AlterDefaultPrivilegesStmt *stmt)
void EventTriggerDDLCommandStart(Node *parsetree)
void EventTriggerInhibitCommandCollection(void)
bool EventTriggerBeginCompleteQuery(void)
bool EventTriggerSupportsObjectType(ObjectType obtype)
Oid CreateEventTrigger(CreateEventTrigStmt *stmt)
Oid AlterEventTrigger(AlterEventTrigStmt *stmt)
void EventTriggerSQLDrop(Node *parsetree)
void EventTriggerEndCompleteQuery(void)
void EventTriggerAlterTableRelid(Oid objectId)
void EventTriggerAlterTableEnd(void)
void EventTriggerCollectSimpleCommand(ObjectAddress address, ObjectAddress secondaryObject, Node *parsetree)
void EventTriggerDDLCommandEnd(Node *parsetree)
void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, ParamListInfo params, DestReceiver *dest)
TupleDesc ExplainResultDesc(ExplainStmt *stmt)
ObjectAddress CreateExtension(ParseState *pstate, CreateExtensionStmt *stmt)
ObjectAddress ExecAlterExtensionStmt(ParseState *pstate, AlterExtensionStmt *stmt)
ObjectAddress ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt, ObjectAddress *objAddr)
void ImportForeignSchema(ImportForeignSchemaStmt *stmt)
ObjectAddress AlterForeignServer(AlterForeignServerStmt *stmt)
ObjectAddress AlterForeignDataWrapper(ParseState *pstate, AlterFdwStmt *stmt)
ObjectAddress CreateForeignServer(CreateForeignServerStmt *stmt)
Oid RemoveUserMapping(DropUserMappingStmt *stmt)
ObjectAddress CreateForeignDataWrapper(ParseState *pstate, CreateFdwStmt *stmt)
ObjectAddress AlterUserMapping(AlterUserMappingStmt *stmt)
void CreateForeignTable(CreateForeignTableStmt *stmt, Oid relid)
ObjectAddress CreateUserMapping(CreateUserMappingStmt *stmt)
void ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver *dest)
ObjectAddress CreateCast(CreateCastStmt *stmt)
ObjectAddress CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt)
ObjectAddress AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt)
TupleDesc CallStmtResultDesc(CallStmt *stmt)
void ExecuteDoStmt(ParseState *pstate, DoStmt *stmt, bool atomic)
ObjectAddress CreateTransform(CreateTransformStmt *stmt)
void GetPGVariable(const char *name, DestReceiver *dest)
void AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
TupleDesc GetPGVariableResultDesc(const char *name)
void SetPGVariable(const char *name, List *args, bool is_local)
void ExecSetVariableStmt(VariableSetStmt *stmt, bool isTopLevel)
ObjectAddress DefineIndex(Oid relationId, IndexStmt *stmt, Oid indexRelationId, Oid parentIndexId, Oid parentConstraintId, bool is_alter_table, bool check_rights, bool check_not_in_use, bool skip_build, bool quiet)
void ExecReindex(ParseState *pstate, ReindexStmt *stmt, bool isTopLevel)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * list_delete_first(List *list)
void list_free(List *list)
List * list_concat(List *list1, const List *list2)
void LockTableCommand(LockStmt *lockstmt)
#define ShareUpdateExclusiveLock
char get_rel_relkind(Oid relid)
ObjectAddress ExecRefreshMatView(RefreshMatViewStmt *stmt, const char *queryString, ParamListInfo params, QueryCompletion *qc)
bool InSecurityRestrictedOperation(void)
BackendType MyBackendType
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
#define IsA(nodeptr, _type_)
@ T_ImportForeignSchemaStmt
@ T_AlterTableSpaceOptionsStmt
@ T_CreateSubscriptionStmt
@ T_CreatePublicationStmt
@ T_CreateForeignTableStmt
@ T_AlterObjectDependsStmt
@ T_AlterForeignServerStmt
@ T_AlterExtensionContentsStmt
@ T_AlterDatabaseRefreshCollStmt
@ T_AlterObjectSchemaStmt
@ T_AlterTSConfigurationStmt
@ T_CreateForeignServerStmt
@ T_CreateUserMappingStmt
@ T_AlterTSDictionaryStmt
@ T_AlterSubscriptionStmt
@ T_AlterDefaultPrivilegesStmt
@ T_AlterTableMoveAllStmt
#define castNode(_type_, nodeptr)
const ObjectAddress InvalidObjectAddress
ObjectAddress DefineOpClass(CreateOpClassStmt *stmt)
ObjectAddress DefineOpFamily(CreateOpFamilyStmt *stmt)
Oid AlterOpFamily(AlterOpFamilyStmt *stmt)
ObjectAddress AlterOperator(AlterOperatorStmt *stmt)
ObjectAddress DefineOperator(List *names, List *parameters)
void free_parsestate(ParseState *pstate)
ParseState * make_parsestate(ParseState *parentParseState)
List * transformCreateStmt(CreateStmt *stmt, const char *queryString)
CreateStatsStmt * transformStatsStmt(Oid relid, CreateStatsStmt *stmt, const char *queryString)
List * expandTableLikeClause(RangeVar *heapRel, TableLikeClause *table_like_clause)
IndexStmt * transformIndexStmt(Oid relid, IndexStmt *stmt, const char *queryString)
@ TRANS_STMT_COMMIT_PREPARED
@ TRANS_STMT_ROLLBACK_PREPARED
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
ObjectAddress CreatePolicy(CreatePolicyStmt *stmt)
ObjectAddress AlterPolicy(AlterPolicyStmt *stmt)
void PerformCursorOpen(ParseState *pstate, DeclareCursorStmt *cstmt, ParamListInfo params, bool isTopLevel)
void PerformPortalClose(const char *name)
void PerformPortalFetch(FetchStmt *stmt, DestReceiver *dest, QueryCompletion *qc)
Portal GetPortalByName(const char *name)
void check_stack_depth(void)
ObjectAddress CreateProceduralLanguage(CreatePLangStmt *stmt)
ObjectAddress CreatePublication(ParseState *pstate, CreatePublicationStmt *stmt)
void AlterPublication(ParseState *pstate, AlterPublicationStmt *stmt)
static long analyze(struct nfa *nfa)
Datum transformRelOptions(Datum oldOptions, List *defList, const char *namspace, char *validnsps[], bool acceptOidsOff, bool isReset)
bytea * heap_reloptions(char relkind, Datum reloptions, bool validate)
#define HEAP_RELOPT_NAMESPACES
ObjectAddress DefineRule(RuleStmt *stmt, const char *queryString)
Oid CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString, int stmt_location, int stmt_len)
ObjectAddress ExecSecLabelStmt(SecLabelStmt *stmt)
ObjectAddress DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
ObjectAddress AlterStatistics(AlterStatsStmt *stmt)
ObjectAddress CreateStatistics(CreateStatsStmt *stmt)
QueryEnvironment * queryEnv
struct RawStmt * raw_parse_tree
QueryEnvironment * p_queryEnv
const char * p_sourcetext
CachedPlanSource * plansource
void DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel)
ObjectAddress CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt, bool isTopLevel)
ObjectAddress AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt, bool isTopLevel)
void AlterTable(AlterTableStmt *stmt, LOCKMODE lockmode, AlterTableUtilityContext *context)
void RemoveRelations(DropStmt *drop)
LOCKMODE AlterTableGetLockLevel(List *cmds)
void ExecuteTruncate(TruncateStmt *stmt)
Oid AlterTableLookupRelation(AlterTableStmt *stmt, LOCKMODE lockmode)
ObjectAddress DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, ObjectAddress *typaddress, const char *queryString)
Oid AlterTableMoveAll(AlterTableMoveAllStmt *stmt)
void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)
void NewRelationCreateToastTable(Oid relOid, Datum reloptions)
void AfterTriggerSetState(ConstraintsSetStmt *stmt)
ObjectAddress CreateTrigger(CreateTrigStmt *stmt, const char *queryString, Oid relOid, Oid refRelOid, Oid constraintOid, Oid indexOid, Oid funcoid, Oid parentTriggerOid, Node *whenClause, bool isInternal, bool in_partition)
ObjectAddress AlterTSConfiguration(AlterTSConfigurationStmt *stmt)
ObjectAddress DefineTSTemplate(List *names, List *parameters)
ObjectAddress DefineTSDictionary(List *names, List *parameters)
ObjectAddress DefineTSConfiguration(List *names, List *parameters, ObjectAddress *copied)
ObjectAddress AlterTSDictionary(AlterTSDictionaryStmt *stmt)
ObjectAddress DefineTSParser(List *names, List *parameters)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
void FinishPreparedTransaction(const char *gid, bool isCommit)
ObjectAddress AlterDomainNotNull(List *names, bool notNull)
ObjectAddress DefineDomain(CreateDomainStmt *stmt)
ObjectAddress DefineType(ParseState *pstate, List *names, List *parameters)
ObjectAddress DefineEnum(CreateEnumStmt *stmt)
ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName, DropBehavior behavior, bool missing_ok)
ObjectAddress AlterEnum(AlterEnumStmt *stmt)
ObjectAddress AlterDomainAddConstraint(List *names, Node *newConstraint, ObjectAddress *constrAddr)
ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName)
ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw)
ObjectAddress DefineCompositeType(RangeVar *typevar, List *coldeflist)
ObjectAddress AlterType(AlterTypeStmt *stmt)
ObjectAddress DefineRange(ParseState *pstate, CreateRangeStmt *stmt)
void ReassignOwnedObjects(ReassignOwnedStmt *stmt)
Oid AlterRole(ParseState *pstate, AlterRoleStmt *stmt)
Oid AlterRoleSet(AlterRoleSetStmt *stmt)
void DropRole(DropRoleStmt *stmt)
Oid CreateRole(ParseState *pstate, CreateRoleStmt *stmt)
void GrantRole(GrantRoleStmt *stmt)
void DropOwnedObjects(DropOwnedStmt *stmt)
static int ClassifyUtilityCommandAsReadOnly(Node *parsetree)
void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
void PreventCommandIfReadOnly(const char *cmdname)
void ProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
void PreventCommandIfParallelMode(const char *cmdname)
bool UtilityReturnsTuples(Node *parsetree)
static void ExecDropStmt(DropStmt *stmt, bool isTopLevel)
bool CommandIsReadOnly(PlannedStmt *pstmt)
static void CheckRestrictedOperation(const char *cmdname)
CommandTag CreateCommandTag(Node *parsetree)
static CommandTag AlterObjectTypeCommandTag(ObjectType objtype)
void ProcessUtilityForAlterTable(Node *stmt, AlterTableUtilityContext *context)
Query * UtilityContainsQuery(Node *parsetree)
ProcessUtility_hook_type ProcessUtility_hook
void PreventCommandDuringRecovery(const char *cmdname)
TupleDesc UtilityTupleDescriptor(Node *parsetree)
LogStmtLevel GetCommandLogLevel(Node *parsetree)
static void ProcessUtilitySlow(ParseState *pstate, PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
#define COMMAND_OK_IN_PARALLEL_MODE
#define COMMAND_OK_IN_RECOVERY
#define COMMAND_IS_STRICTLY_READ_ONLY
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
#define COMMAND_IS_NOT_READ_ONLY
@ PROCESS_UTILITY_SUBCOMMAND
@ PROCESS_UTILITY_TOPLEVEL
@ PROCESS_UTILITY_QUERY_NONATOMIC
#define COMMAND_OK_IN_READ_ONLY_TXN
void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
ObjectAddress DefineView(ViewStmt *stmt, const char *queryString, int stmt_location, int stmt_len)
void WarnNoTransactionBlock(bool isTopLevel, const char *stmtType)
void UserAbortTransactionBlock(bool chain)
bool PrepareTransactionBlock(const char *gid)
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)
void DefineSavepoint(const char *name)
void CommandCounterIncrement(void)
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
void ReleaseSavepoint(const char *name)
bool IsTransactionBlock(void)
bool IsInParallelMode(void)
void BeginTransactionBlock(void)
void RollbackToSavepoint(const char *name)
bool EndTransactionBlock(bool chain)
bool RecoveryInProgress(void)
#define CHECKPOINT_IMMEDIATE