76 const char *queryString,
132 case T_AlterCollationStmt:
133 case T_AlterDatabaseRefreshCollStmt:
134 case T_AlterDatabaseSetStmt:
135 case T_AlterDatabaseStmt:
136 case T_AlterDefaultPrivilegesStmt:
137 case T_AlterDomainStmt:
138 case T_AlterEnumStmt:
139 case T_AlterEventTrigStmt:
140 case T_AlterExtensionContentsStmt:
141 case T_AlterExtensionStmt:
143 case T_AlterForeignServerStmt:
144 case T_AlterFunctionStmt:
145 case T_AlterObjectDependsStmt:
146 case T_AlterObjectSchemaStmt:
147 case T_AlterOpFamilyStmt:
148 case T_AlterOperatorStmt:
149 case T_AlterOwnerStmt:
150 case T_AlterPolicyStmt:
151 case T_AlterPublicationStmt:
152 case T_AlterRoleSetStmt:
153 case T_AlterRoleStmt:
155 case T_AlterStatsStmt:
156 case T_AlterSubscriptionStmt:
157 case T_AlterTSConfigurationStmt:
158 case T_AlterTSDictionaryStmt:
159 case T_AlterTableMoveAllStmt:
160 case T_AlterTableSpaceOptionsStmt:
161 case T_AlterTableStmt:
162 case T_AlterTypeStmt:
163 case T_AlterUserMappingStmt:
165 case T_CompositeTypeStmt:
167 case T_CreateCastStmt:
168 case T_CreateConversionStmt:
169 case T_CreateDomainStmt:
170 case T_CreateEnumStmt:
171 case T_CreateEventTrigStmt:
172 case T_CreateExtensionStmt:
173 case T_CreateFdwStmt:
174 case T_CreateForeignServerStmt:
175 case T_CreateForeignTableStmt:
176 case T_CreateFunctionStmt:
177 case T_CreateOpClassStmt:
178 case T_CreateOpFamilyStmt:
179 case T_CreatePLangStmt:
180 case T_CreatePolicyStmt:
181 case T_CreatePublicationStmt:
182 case T_CreateRangeStmt:
183 case T_CreateRoleStmt:
184 case T_CreateSchemaStmt:
185 case T_CreateSeqStmt:
186 case T_CreateStatsStmt:
188 case T_CreateSubscriptionStmt:
189 case T_CreateTableAsStmt:
190 case T_CreateTableSpaceStmt:
191 case T_CreateTransformStmt:
192 case T_CreateTrigStmt:
193 case T_CreateUserMappingStmt:
196 case T_DropOwnedStmt:
199 case T_DropSubscriptionStmt:
200 case T_DropTableSpaceStmt:
201 case T_DropUserMappingStmt:
203 case T_GrantRoleStmt:
205 case T_ImportForeignSchemaStmt:
207 case T_ReassignOwnedStmt:
208 case T_RefreshMatViewStmt:
219 case T_AlterSystemStmt:
246 case T_CheckPointStmt:
258 case T_ClosePortalStmt:
259 case T_ConstraintsSetStmt:
260 case T_DeallocateStmt:
261 case T_DeclareCursorStmt:
268 case T_VariableSetStmt:
316 case T_VariableShowStmt:
356 case T_TransactionStmt:
385 elog(
ERROR,
"unrecognized TransactionStmtKind: %d",
391 elog(
ERROR,
"unrecognized node type: %d",
408 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
410 errmsg(
"cannot execute %s in a read-only transaction",
426 (
errcode(ERRCODE_INVALID_TRANSACTION_STATE),
428 errmsg(
"cannot execute %s during a parallel operation",
445 (
errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION),
447 errmsg(
"cannot execute %s during recovery",
463 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
465 errmsg(
"cannot execute %s within security-restricted operation",
500 const char *queryString,
510 Assert(queryString != NULL);
519 (*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,
520 context, params, queryEnv,
524 context, params, queryEnv,
541 const char *queryString,
594 case T_TransactionStmt:
610 foreach(lc,
stmt->options)
614 if (strcmp(item->
defname,
"transaction_isolation") == 0)
618 else if (strcmp(item->
defname,
"transaction_read_only") == 0)
622 else if (strcmp(item->
defname,
"transaction_deferrable") == 0)
688 case T_DeclareCursorStmt:
693 case T_ClosePortalStmt:
710 case T_CreateTableSpaceStmt:
716 case T_DropTableSpaceStmt:
722 case T_AlterTableSpaceOptionsStmt:
756 case T_DeallocateStmt:
761 case T_GrantRoleStmt:
772 case T_AlterDatabaseStmt:
777 case T_AlterDatabaseRefreshCollStmt:
782 case T_AlterDatabaseSetStmt:
819 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
821 errmsg(
"cannot execute %s within a background process",
833 if (
stmt->conditionname)
866 case T_AlterSystemStmt:
871 case T_VariableSetStmt:
875 case T_VariableShowStmt:
889 case T_CreateEventTrigStmt:
894 case T_AlterEventTrigStmt:
902 case T_CreateRoleStmt:
907 case T_AlterRoleStmt:
912 case T_AlterRoleSetStmt:
922 case T_ReassignOwnedStmt:
937 case T_ConstraintsSetStmt:
942 case T_CheckPointStmt:
945 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
947 errmsg(
"permission denied to execute %s command",
949 errdetail(
"Only roles with privileges of the \"%s\" role may execute this command.",
967 context, params, queryEnv,
980 context, params, queryEnv,
993 context, params, queryEnv,
1000 case T_AlterObjectDependsStmt:
1006 context, params, queryEnv,
1013 case T_AlterObjectSchemaStmt:
1019 context, params, queryEnv,
1026 case T_AlterOwnerStmt:
1032 context, params, queryEnv,
1045 context, params, queryEnv,
1052 case T_SecLabelStmt:
1058 context, params, queryEnv,
1068 context, params, queryEnv,
1091 const char *queryString,
1102 bool commandCollected =
false;
1112 if (isCompleteQuery)
1120 case T_CreateSchemaStmt:
1130 commandCollected =
true;
1134 case T_CreateForeignTableStmt:
1148 while (stmts !=
NIL)
1157 Datum toast_options;
1204 RELKIND_FOREIGN_TABLE,
1224 Assert(table_rv != NULL);
1264 commandCollected =
true;
1268 case T_AlterTableStmt:
1280 foreach(cell, atstmt->
cmds)
1289 "ALTER TABLE ... DETACH CONCURRENTLY");
1307 atcontext.
pstmt = pstmt;
1309 atcontext.
relid = relid;
1310 atcontext.
params = params;
1325 (
errmsg(
"relation \"%s\" does not exist, skipping",
1330 commandCollected =
true;
1333 case T_AlterDomainStmt:
1341 switch (
stmt->subtype)
1382 elog(
ERROR,
"unrecognized alter domain type: %d",
1383 (
int)
stmt->subtype);
1442 stmt->if_not_exists);
1445 elog(
ERROR,
"unrecognized define stmt type: %d",
1458 bool is_alter_table;
1460 if (
stmt->concurrent)
1462 "CREATE INDEX CONCURRENTLY");
1492 if (
stmt->relation->inh &&
1499 foreach(lc, inheritors)
1504 if (relkind != RELKIND_RELATION &&
1505 relkind != RELKIND_MATVIEW &&
1506 relkind != RELKIND_PARTITIONED_TABLE &&
1507 relkind != RELKIND_FOREIGN_TABLE)
1508 elog(
ERROR,
"unexpected relkind \"%c\" on partition \"%s\"",
1509 relkind,
stmt->relation->relname);
1511 if (relkind == RELKIND_FOREIGN_TABLE &&
1514 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1515 errmsg(
"cannot create unique index on partitioned table \"%s\"",
1516 stmt->relation->relname),
1517 errdetail(
"Table \"%s\" contains partitions that are foreign tables.",
1518 stmt->relation->relname)));
1534 is_alter_table =
stmt->transformed;
1561 commandCollected =
true;
1570 commandCollected =
true;
1573 case T_CreateExtensionStmt:
1577 case T_AlterExtensionStmt:
1581 case T_AlterExtensionContentsStmt:
1586 case T_CreateFdwStmt:
1590 case T_AlterFdwStmt:
1594 case T_CreateForeignServerStmt:
1598 case T_AlterForeignServerStmt:
1602 case T_CreateUserMappingStmt:
1606 case T_AlterUserMappingStmt:
1610 case T_DropUserMappingStmt:
1613 commandCollected =
true;
1616 case T_ImportForeignSchemaStmt:
1619 commandCollected =
true;
1622 case T_CompositeTypeStmt:
1631 case T_CreateEnumStmt:
1635 case T_CreateRangeStmt:
1639 case T_AlterEnumStmt:
1650 commandCollected =
true;
1654 case T_CreateFunctionStmt:
1658 case T_AlterFunctionStmt:
1666 case T_CreateSeqStmt:
1670 case T_AlterSeqStmt:
1674 case T_CreateTableAsStmt:
1676 params, queryEnv, qc);
1679 case T_RefreshMatViewStmt:
1691 queryString, params, qc);
1700 case T_CreateTrigStmt:
1707 case T_CreatePLangStmt:
1711 case T_CreateDomainStmt:
1715 case T_CreateConversionStmt:
1719 case T_CreateCastStmt:
1723 case T_CreateOpClassStmt:
1726 commandCollected =
true;
1729 case T_CreateOpFamilyStmt:
1736 commandCollected =
true;
1739 case T_CreateTransformStmt:
1743 case T_AlterOpFamilyStmt:
1746 commandCollected =
true;
1749 case T_AlterTSDictionaryStmt:
1753 case T_AlterTSConfigurationStmt:
1761 commandCollected =
true;
1764 case T_AlterTableMoveAllStmt:
1767 commandCollected =
true;
1773 commandCollected =
true;
1780 case T_AlterObjectDependsStmt:
1786 case T_AlterObjectSchemaStmt:
1792 case T_AlterOwnerStmt:
1796 case T_AlterOperatorStmt:
1800 case T_AlterTypeStmt:
1811 commandCollected =
true;
1814 case T_DropOwnedStmt:
1817 commandCollected =
true;
1820 case T_AlterDefaultPrivilegesStmt:
1823 commandCollected =
true;
1826 case T_CreatePolicyStmt:
1830 case T_AlterPolicyStmt:
1834 case T_SecLabelStmt:
1838 case T_CreateAmStmt:
1842 case T_CreatePublicationStmt:
1846 case T_AlterPublicationStmt:
1853 commandCollected =
true;
1856 case T_CreateSubscriptionStmt:
1862 case T_AlterSubscriptionStmt:
1868 case T_DropSubscriptionStmt:
1871 commandCollected =
true;
1874 case T_CreateStatsStmt:
1882 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1883 errmsg(
"only a single relation is allowed in CREATE STATISTICS")));
1905 case T_AlterStatsStmt:
1909 case T_AlterCollationStmt:
1914 elog(
ERROR,
"unrecognized node type: %d",
1923 if (!commandCollected)
1927 if (isCompleteQuery)
1994 switch (
stmt->removeType)
1997 if (
stmt->concurrent)
1999 "DROP INDEX CONCURRENTLY");
2033 return (
stmt->funcexpr->funcresulttype == RECORDOID);
2064 case T_VariableShowStmt:
2115 case T_VariableShowStmt:
2134 QueryReturnsTuples(
Query *parsetree)
2182 case T_DeclareCursorStmt:
2194 case T_CreateTableAsStmt:
2220 tag = CMDTAG_ALTER_AGGREGATE;
2223 tag = CMDTAG_ALTER_TYPE;
2226 tag = CMDTAG_ALTER_CAST;
2229 tag = CMDTAG_ALTER_COLLATION;
2232 tag = CMDTAG_ALTER_TABLE;
2235 tag = CMDTAG_ALTER_CONVERSION;
2238 tag = CMDTAG_ALTER_DATABASE;
2242 tag = CMDTAG_ALTER_DOMAIN;
2245 tag = CMDTAG_ALTER_EXTENSION;
2248 tag = CMDTAG_ALTER_FOREIGN_DATA_WRAPPER;
2251 tag = CMDTAG_ALTER_SERVER;
2254 tag = CMDTAG_ALTER_FOREIGN_TABLE;
2257 tag = CMDTAG_ALTER_FUNCTION;
2260 tag = CMDTAG_ALTER_INDEX;
2263 tag = CMDTAG_ALTER_LANGUAGE;
2266 tag = CMDTAG_ALTER_LARGE_OBJECT;
2269 tag = CMDTAG_ALTER_OPERATOR_CLASS;
2272 tag = CMDTAG_ALTER_OPERATOR;
2275 tag = CMDTAG_ALTER_OPERATOR_FAMILY;
2278 tag = CMDTAG_ALTER_POLICY;
2281 tag = CMDTAG_ALTER_PROCEDURE;
2284 tag = CMDTAG_ALTER_ROLE;
2287 tag = CMDTAG_ALTER_ROUTINE;
2290 tag = CMDTAG_ALTER_RULE;
2293 tag = CMDTAG_ALTER_SCHEMA;
2296 tag = CMDTAG_ALTER_SEQUENCE;
2300 tag = CMDTAG_ALTER_TABLE;
2303 tag = CMDTAG_ALTER_TABLESPACE;
2306 tag = CMDTAG_ALTER_TRIGGER;
2309 tag = CMDTAG_ALTER_EVENT_TRIGGER;
2312 tag = CMDTAG_ALTER_TEXT_SEARCH_CONFIGURATION;
2315 tag = CMDTAG_ALTER_TEXT_SEARCH_DICTIONARY;
2318 tag = CMDTAG_ALTER_TEXT_SEARCH_PARSER;
2321 tag = CMDTAG_ALTER_TEXT_SEARCH_TEMPLATE;
2324 tag = CMDTAG_ALTER_TYPE;
2327 tag = CMDTAG_ALTER_VIEW;
2330 tag = CMDTAG_ALTER_MATERIALIZED_VIEW;
2333 tag = CMDTAG_ALTER_PUBLICATION;
2336 tag = CMDTAG_ALTER_SUBSCRIPTION;
2339 tag = CMDTAG_ALTER_STATISTICS;
2342 tag = CMDTAG_UNKNOWN;
2372 tag = CMDTAG_INSERT;
2376 tag = CMDTAG_DELETE;
2380 tag = CMDTAG_UPDATE;
2388 tag = CMDTAG_SELECT;
2391 case T_PLAssignStmt:
2392 tag = CMDTAG_SELECT;
2396 case T_TransactionStmt:
2407 tag = CMDTAG_START_TRANSACTION;
2411 tag = CMDTAG_COMMIT;
2416 tag = CMDTAG_ROLLBACK;
2420 tag = CMDTAG_SAVEPOINT;
2424 tag = CMDTAG_RELEASE;
2428 tag = CMDTAG_PREPARE_TRANSACTION;
2432 tag = CMDTAG_COMMIT_PREPARED;
2436 tag = CMDTAG_ROLLBACK_PREPARED;
2440 tag = CMDTAG_UNKNOWN;
2446 case T_DeclareCursorStmt:
2447 tag = CMDTAG_DECLARE_CURSOR;
2450 case T_ClosePortalStmt:
2454 if (
stmt->portalname == NULL)
2455 tag = CMDTAG_CLOSE_CURSOR_ALL;
2457 tag = CMDTAG_CLOSE_CURSOR;
2465 tag = (
stmt->ismove) ? CMDTAG_MOVE : CMDTAG_FETCH;
2469 case T_CreateDomainStmt:
2470 tag = CMDTAG_CREATE_DOMAIN;
2473 case T_CreateSchemaStmt:
2474 tag = CMDTAG_CREATE_SCHEMA;
2478 tag = CMDTAG_CREATE_TABLE;
2481 case T_CreateTableSpaceStmt:
2482 tag = CMDTAG_CREATE_TABLESPACE;
2485 case T_DropTableSpaceStmt:
2486 tag = CMDTAG_DROP_TABLESPACE;
2489 case T_AlterTableSpaceOptionsStmt:
2490 tag = CMDTAG_ALTER_TABLESPACE;
2493 case T_CreateExtensionStmt:
2494 tag = CMDTAG_CREATE_EXTENSION;
2497 case T_AlterExtensionStmt:
2498 tag = CMDTAG_ALTER_EXTENSION;
2501 case T_AlterExtensionContentsStmt:
2502 tag = CMDTAG_ALTER_EXTENSION;
2505 case T_CreateFdwStmt:
2506 tag = CMDTAG_CREATE_FOREIGN_DATA_WRAPPER;
2509 case T_AlterFdwStmt:
2510 tag = CMDTAG_ALTER_FOREIGN_DATA_WRAPPER;
2513 case T_CreateForeignServerStmt:
2514 tag = CMDTAG_CREATE_SERVER;
2517 case T_AlterForeignServerStmt:
2518 tag = CMDTAG_ALTER_SERVER;
2521 case T_CreateUserMappingStmt:
2522 tag = CMDTAG_CREATE_USER_MAPPING;
2525 case T_AlterUserMappingStmt:
2526 tag = CMDTAG_ALTER_USER_MAPPING;
2529 case T_DropUserMappingStmt:
2530 tag = CMDTAG_DROP_USER_MAPPING;
2533 case T_CreateForeignTableStmt:
2534 tag = CMDTAG_CREATE_FOREIGN_TABLE;
2537 case T_ImportForeignSchemaStmt:
2538 tag = CMDTAG_IMPORT_FOREIGN_SCHEMA;
2542 switch (((
DropStmt *) parsetree)->removeType)
2545 tag = CMDTAG_DROP_TABLE;
2548 tag = CMDTAG_DROP_SEQUENCE;
2551 tag = CMDTAG_DROP_VIEW;
2554 tag = CMDTAG_DROP_MATERIALIZED_VIEW;
2557 tag = CMDTAG_DROP_INDEX;
2560 tag = CMDTAG_DROP_TYPE;
2563 tag = CMDTAG_DROP_DOMAIN;
2566 tag = CMDTAG_DROP_COLLATION;
2569 tag = CMDTAG_DROP_CONVERSION;
2572 tag = CMDTAG_DROP_SCHEMA;
2575 tag = CMDTAG_DROP_TEXT_SEARCH_PARSER;
2578 tag = CMDTAG_DROP_TEXT_SEARCH_DICTIONARY;
2581 tag = CMDTAG_DROP_TEXT_SEARCH_TEMPLATE;
2584 tag = CMDTAG_DROP_TEXT_SEARCH_CONFIGURATION;
2587 tag = CMDTAG_DROP_FOREIGN_TABLE;
2590 tag = CMDTAG_DROP_EXTENSION;
2593 tag = CMDTAG_DROP_FUNCTION;
2596 tag = CMDTAG_DROP_PROCEDURE;
2599 tag = CMDTAG_DROP_ROUTINE;
2602 tag = CMDTAG_DROP_AGGREGATE;
2605 tag = CMDTAG_DROP_OPERATOR;
2608 tag = CMDTAG_DROP_LANGUAGE;
2611 tag = CMDTAG_DROP_CAST;
2614 tag = CMDTAG_DROP_TRIGGER;
2617 tag = CMDTAG_DROP_EVENT_TRIGGER;
2620 tag = CMDTAG_DROP_RULE;
2623 tag = CMDTAG_DROP_FOREIGN_DATA_WRAPPER;
2626 tag = CMDTAG_DROP_SERVER;
2629 tag = CMDTAG_DROP_OPERATOR_CLASS;
2632 tag = CMDTAG_DROP_OPERATOR_FAMILY;
2635 tag = CMDTAG_DROP_POLICY;
2638 tag = CMDTAG_DROP_TRANSFORM;
2641 tag = CMDTAG_DROP_ACCESS_METHOD;
2644 tag = CMDTAG_DROP_PUBLICATION;
2647 tag = CMDTAG_DROP_STATISTICS;
2650 tag = CMDTAG_UNKNOWN;
2654 case T_TruncateStmt:
2655 tag = CMDTAG_TRUNCATE_TABLE;
2659 tag = CMDTAG_COMMENT;
2662 case T_SecLabelStmt:
2663 tag = CMDTAG_SECURITY_LABEL;
2681 case T_AlterObjectDependsStmt:
2685 case T_AlterObjectSchemaStmt:
2689 case T_AlterOwnerStmt:
2693 case T_AlterTableMoveAllStmt:
2697 case T_AlterTableStmt:
2701 case T_AlterDomainStmt:
2702 tag = CMDTAG_ALTER_DOMAIN;
2705 case T_AlterFunctionStmt:
2709 tag = CMDTAG_ALTER_FUNCTION;
2712 tag = CMDTAG_ALTER_PROCEDURE;
2715 tag = CMDTAG_ALTER_ROUTINE;
2718 tag = CMDTAG_UNKNOWN;
2726 tag = (
stmt->is_grant) ? CMDTAG_GRANT : CMDTAG_REVOKE;
2730 case T_GrantRoleStmt:
2734 tag = (
stmt->is_grant) ? CMDTAG_GRANT_ROLE : CMDTAG_REVOKE_ROLE;
2738 case T_AlterDefaultPrivilegesStmt:
2739 tag = CMDTAG_ALTER_DEFAULT_PRIVILEGES;
2746 tag = CMDTAG_CREATE_AGGREGATE;
2749 tag = CMDTAG_CREATE_OPERATOR;
2752 tag = CMDTAG_CREATE_TYPE;
2755 tag = CMDTAG_CREATE_TEXT_SEARCH_PARSER;
2758 tag = CMDTAG_CREATE_TEXT_SEARCH_DICTIONARY;
2761 tag = CMDTAG_CREATE_TEXT_SEARCH_TEMPLATE;
2764 tag = CMDTAG_CREATE_TEXT_SEARCH_CONFIGURATION;
2767 tag = CMDTAG_CREATE_COLLATION;
2770 tag = CMDTAG_CREATE_ACCESS_METHOD;
2773 tag = CMDTAG_UNKNOWN;
2777 case T_CompositeTypeStmt:
2778 tag = CMDTAG_CREATE_TYPE;
2781 case T_CreateEnumStmt:
2782 tag = CMDTAG_CREATE_TYPE;
2785 case T_CreateRangeStmt:
2786 tag = CMDTAG_CREATE_TYPE;
2789 case T_AlterEnumStmt:
2790 tag = CMDTAG_ALTER_TYPE;
2794 tag = CMDTAG_CREATE_VIEW;
2797 case T_CreateFunctionStmt:
2799 tag = CMDTAG_CREATE_PROCEDURE;
2801 tag = CMDTAG_CREATE_FUNCTION;
2805 tag = CMDTAG_CREATE_INDEX;
2809 tag = CMDTAG_CREATE_RULE;
2812 case T_CreateSeqStmt:
2813 tag = CMDTAG_CREATE_SEQUENCE;
2816 case T_AlterSeqStmt:
2817 tag = CMDTAG_ALTER_SEQUENCE;
2824 case T_CreatedbStmt:
2825 tag = CMDTAG_CREATE_DATABASE;
2828 case T_AlterDatabaseStmt:
2829 case T_AlterDatabaseRefreshCollStmt:
2830 case T_AlterDatabaseSetStmt:
2831 tag = CMDTAG_ALTER_DATABASE;
2835 tag = CMDTAG_DROP_DATABASE;
2839 tag = CMDTAG_NOTIFY;
2843 tag = CMDTAG_LISTEN;
2846 case T_UnlistenStmt:
2847 tag = CMDTAG_UNLISTEN;
2859 tag = CMDTAG_CLUSTER;
2863 if (((
VacuumStmt *) parsetree)->is_vacuumcmd)
2864 tag = CMDTAG_VACUUM;
2866 tag = CMDTAG_ANALYZE;
2870 tag = CMDTAG_EXPLAIN;
2873 case T_CreateTableAsStmt:
2878 tag = CMDTAG_SELECT_INTO;
2880 tag = CMDTAG_CREATE_TABLE_AS;
2883 tag = CMDTAG_CREATE_MATERIALIZED_VIEW;
2886 tag = CMDTAG_UNKNOWN;
2890 case T_RefreshMatViewStmt:
2891 tag = CMDTAG_REFRESH_MATERIALIZED_VIEW;
2894 case T_AlterSystemStmt:
2895 tag = CMDTAG_ALTER_SYSTEM;
2898 case T_VariableSetStmt:
2912 tag = CMDTAG_UNKNOWN;
2916 case T_VariableShowStmt:
2924 tag = CMDTAG_DISCARD_ALL;
2927 tag = CMDTAG_DISCARD_PLANS;
2930 tag = CMDTAG_DISCARD_TEMP;
2933 tag = CMDTAG_DISCARD_SEQUENCES;
2936 tag = CMDTAG_UNKNOWN;
2940 case T_CreateTransformStmt:
2941 tag = CMDTAG_CREATE_TRANSFORM;
2944 case T_CreateTrigStmt:
2945 tag = CMDTAG_CREATE_TRIGGER;
2948 case T_CreateEventTrigStmt:
2949 tag = CMDTAG_CREATE_EVENT_TRIGGER;
2952 case T_AlterEventTrigStmt:
2953 tag = CMDTAG_ALTER_EVENT_TRIGGER;
2956 case T_CreatePLangStmt:
2957 tag = CMDTAG_CREATE_LANGUAGE;
2960 case T_CreateRoleStmt:
2961 tag = CMDTAG_CREATE_ROLE;
2964 case T_AlterRoleStmt:
2965 tag = CMDTAG_ALTER_ROLE;
2968 case T_AlterRoleSetStmt:
2969 tag = CMDTAG_ALTER_ROLE;
2972 case T_DropRoleStmt:
2973 tag = CMDTAG_DROP_ROLE;
2976 case T_DropOwnedStmt:
2977 tag = CMDTAG_DROP_OWNED;
2980 case T_ReassignOwnedStmt:
2981 tag = CMDTAG_REASSIGN_OWNED;
2985 tag = CMDTAG_LOCK_TABLE;
2988 case T_ConstraintsSetStmt:
2989 tag = CMDTAG_SET_CONSTRAINTS;
2992 case T_CheckPointStmt:
2993 tag = CMDTAG_CHECKPOINT;
2997 tag = CMDTAG_REINDEX;
3000 case T_CreateConversionStmt:
3001 tag = CMDTAG_CREATE_CONVERSION;
3004 case T_CreateCastStmt:
3005 tag = CMDTAG_CREATE_CAST;
3008 case T_CreateOpClassStmt:
3009 tag = CMDTAG_CREATE_OPERATOR_CLASS;
3012 case T_CreateOpFamilyStmt:
3013 tag = CMDTAG_CREATE_OPERATOR_FAMILY;
3016 case T_AlterOpFamilyStmt:
3017 tag = CMDTAG_ALTER_OPERATOR_FAMILY;
3020 case T_AlterOperatorStmt:
3021 tag = CMDTAG_ALTER_OPERATOR;
3024 case T_AlterTypeStmt:
3025 tag = CMDTAG_ALTER_TYPE;
3028 case T_AlterTSDictionaryStmt:
3029 tag = CMDTAG_ALTER_TEXT_SEARCH_DICTIONARY;
3032 case T_AlterTSConfigurationStmt:
3033 tag = CMDTAG_ALTER_TEXT_SEARCH_CONFIGURATION;
3036 case T_CreatePolicyStmt:
3037 tag = CMDTAG_CREATE_POLICY;
3040 case T_AlterPolicyStmt:
3041 tag = CMDTAG_ALTER_POLICY;
3044 case T_CreateAmStmt:
3045 tag = CMDTAG_CREATE_ACCESS_METHOD;
3048 case T_CreatePublicationStmt:
3049 tag = CMDTAG_CREATE_PUBLICATION;
3052 case T_AlterPublicationStmt:
3053 tag = CMDTAG_ALTER_PUBLICATION;
3056 case T_CreateSubscriptionStmt:
3057 tag = CMDTAG_CREATE_SUBSCRIPTION;
3060 case T_AlterSubscriptionStmt:
3061 tag = CMDTAG_ALTER_SUBSCRIPTION;
3064 case T_DropSubscriptionStmt:
3065 tag = CMDTAG_DROP_SUBSCRIPTION;
3068 case T_AlterCollationStmt:
3069 tag = CMDTAG_ALTER_COLLATION;
3073 tag = CMDTAG_PREPARE;
3077 tag = CMDTAG_EXECUTE;
3080 case T_CreateStatsStmt:
3081 tag = CMDTAG_CREATE_STATISTICS;
3084 case T_AlterStatsStmt:
3085 tag = CMDTAG_ALTER_STATISTICS;
3088 case T_DeallocateStmt:
3092 if (
stmt->name == NULL)
3093 tag = CMDTAG_DEALLOCATE_ALL;
3095 tag = CMDTAG_DEALLOCATE;
3104 switch (
stmt->commandType)
3119 tag = CMDTAG_SELECT_FOR_KEY_SHARE;
3122 tag = CMDTAG_SELECT_FOR_SHARE;
3125 tag = CMDTAG_SELECT_FOR_NO_KEY_UPDATE;
3128 tag = CMDTAG_SELECT_FOR_UPDATE;
3131 tag = CMDTAG_SELECT;
3136 tag = CMDTAG_SELECT;
3139 tag = CMDTAG_UPDATE;
3142 tag = CMDTAG_INSERT;
3145 tag = CMDTAG_DELETE;
3155 (
int)
stmt->commandType);
3156 tag = CMDTAG_UNKNOWN;
3167 switch (
stmt->commandType)
3182 tag = CMDTAG_SELECT_FOR_KEY_SHARE;
3185 tag = CMDTAG_SELECT_FOR_SHARE;
3188 tag = CMDTAG_SELECT_FOR_NO_KEY_UPDATE;
3191 tag = CMDTAG_SELECT_FOR_UPDATE;
3194 tag = CMDTAG_UNKNOWN;
3199 tag = CMDTAG_SELECT;
3202 tag = CMDTAG_UPDATE;
3205 tag = CMDTAG_INSERT;
3208 tag = CMDTAG_DELETE;
3218 (
int)
stmt->commandType);
3219 tag = CMDTAG_UNKNOWN;
3228 tag = CMDTAG_UNKNOWN;
3272 case T_PLAssignStmt:
3277 case T_TransactionStmt:
3281 case T_DeclareCursorStmt:
3285 case T_ClosePortalStmt:
3293 case T_CreateSchemaStmt:
3298 case T_CreateForeignTableStmt:
3302 case T_CreateTableSpaceStmt:
3303 case T_DropTableSpaceStmt:
3304 case T_AlterTableSpaceOptionsStmt:
3308 case T_CreateExtensionStmt:
3309 case T_AlterExtensionStmt:
3310 case T_AlterExtensionContentsStmt:
3314 case T_CreateFdwStmt:
3315 case T_AlterFdwStmt:
3316 case T_CreateForeignServerStmt:
3317 case T_AlterForeignServerStmt:
3318 case T_CreateUserMappingStmt:
3319 case T_AlterUserMappingStmt:
3320 case T_DropUserMappingStmt:
3321 case T_ImportForeignSchemaStmt:
3329 case T_TruncateStmt:
3337 case T_SecLabelStmt:
3342 if (((
CopyStmt *) parsetree)->is_from)
3364 if (
ps &&
ps->plansource->raw_parse_tree)
3371 case T_DeallocateStmt:
3379 case T_AlterObjectDependsStmt:
3383 case T_AlterObjectSchemaStmt:
3387 case T_AlterOwnerStmt:
3391 case T_AlterOperatorStmt:
3395 case T_AlterTypeStmt:
3399 case T_AlterTableMoveAllStmt:
3400 case T_AlterTableStmt:
3404 case T_AlterDomainStmt:
3412 case T_GrantRoleStmt:
3416 case T_AlterDefaultPrivilegesStmt:
3424 case T_CompositeTypeStmt:
3428 case T_CreateEnumStmt:
3432 case T_CreateRangeStmt:
3436 case T_AlterEnumStmt:
3444 case T_CreateFunctionStmt:
3448 case T_AlterFunctionStmt:
3460 case T_CreateSeqStmt:
3464 case T_AlterSeqStmt:
3472 case T_CreatedbStmt:
3476 case T_AlterDatabaseStmt:
3477 case T_AlterDatabaseRefreshCollStmt:
3478 case T_AlterDatabaseSetStmt:
3494 case T_UnlistenStmt:
3521 foreach(lc,
stmt->options)
3525 if (strcmp(opt->
defname,
"analyze") == 0)
3537 case T_CreateTableAsStmt:
3541 case T_RefreshMatViewStmt:
3545 case T_AlterSystemStmt:
3549 case T_VariableSetStmt:
3553 case T_VariableShowStmt:
3561 case T_CreateTrigStmt:
3565 case T_CreateEventTrigStmt:
3569 case T_AlterEventTrigStmt:
3573 case T_CreatePLangStmt:
3577 case T_CreateDomainStmt:
3581 case T_CreateRoleStmt:
3585 case T_AlterRoleStmt:
3589 case T_AlterRoleSetStmt:
3593 case T_DropRoleStmt:
3597 case T_DropOwnedStmt:
3601 case T_ReassignOwnedStmt:
3609 case T_ConstraintsSetStmt:
3613 case T_CheckPointStmt:
3621 case T_CreateConversionStmt:
3625 case T_CreateCastStmt:
3629 case T_CreateOpClassStmt:
3633 case T_CreateOpFamilyStmt:
3637 case T_CreateTransformStmt:
3641 case T_AlterOpFamilyStmt:
3645 case T_CreatePolicyStmt:
3649 case T_AlterPolicyStmt:
3653 case T_AlterTSDictionaryStmt:
3657 case T_AlterTSConfigurationStmt:
3661 case T_CreateAmStmt:
3665 case T_CreatePublicationStmt:
3669 case T_AlterPublicationStmt:
3673 case T_CreateSubscriptionStmt:
3677 case T_AlterSubscriptionStmt:
3681 case T_DropSubscriptionStmt:
3685 case T_CreateStatsStmt:
3689 case T_AlterStatsStmt:
3693 case T_AlterCollationStmt:
3702 switch (
stmt->commandType)
3721 (
int)
stmt->commandType);
3733 switch (
stmt->commandType)
3752 (
int)
stmt->commandType);
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)
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(ParseState *pstate, GrantRoleStmt *stmt)
void DropOwnedObjects(DropOwnedStmt *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 DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
ObjectAddress AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
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 AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
void GetPGVariable(const char *name, DestReceiver *dest)
TupleDesc GetPGVariableResultDesc(const char *name)
void SetPGVariable(const char *name, List *args, bool is_local)
void ExecSetVariableStmt(VariableSetStmt *stmt, bool isTopLevel)
void ExecReindex(ParseState *pstate, const ReindexStmt *stmt, bool isTopLevel)
ObjectAddress DefineIndex(Oid tableId, IndexStmt *stmt, Oid indexRelationId, Oid parentIndexId, Oid parentConstraintId, int total_parts, bool is_alter_table, bool check_rights, bool check_not_in_use, bool skip_build, bool quiet)
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_)
#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)
static int list_length(const List *l)
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 AlterStatistics(AlterStatsStmt *stmt)
ObjectAddress CreateStatistics(CreateStatsStmt *stmt)
QueryEnvironment * queryEnv
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)
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