PostgreSQL Source Code  git master
test_oat_hooks.c
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------
2  *
3  * test_oat_hooks.c
4  * Code for testing mandatory access control (MAC) using object access hooks.
5  *
6  * Copyright (c) 2015-2022, PostgreSQL Global Development Group
7  *
8  * IDENTIFICATION
9  * src/test/modules/test_oat_hooks/test_oat_hooks.c
10  *
11  * -------------------------------------------------------------------------
12  */
13 
14 #include "postgres.h"
15 
16 #include "access/parallel.h"
17 #include "catalog/dependency.h"
18 #include "catalog/objectaccess.h"
19 #include "catalog/pg_proc.h"
20 #include "executor/executor.h"
21 #include "fmgr.h"
22 #include "miscadmin.h"
23 #include "tcop/utility.h"
24 
26 
27 /*
28  * GUCs controlling which operations to deny
29  */
30 static bool REGRESS_deny_set_variable = false;
31 static bool REGRESS_deny_alter_system = false;
32 static bool REGRESS_deny_object_access = false;
33 static bool REGRESS_deny_exec_perms = false;
34 static bool REGRESS_deny_utility_commands = false;
35 static bool REGRESS_audit = false;
36 
37 /*
38  * GUCs for testing privileges on USERSET and SUSET variables,
39  * with and without privileges granted prior to module load.
40  */
41 static bool REGRESS_userset_variable1 = false;
42 static bool REGRESS_userset_variable2 = false;
43 static bool REGRESS_suset_variable1 = false;
44 static bool REGRESS_suset_variable2 = false;
45 
46 /* Saved hook values */
51 
52 /* Test Object Access Type Hook hooks */
54  Oid classId, const char *objName,
55  int subId, void *arg);
56 static void REGRESS_object_access_hook(ObjectAccessType access, Oid classId,
57  Oid objectId, int subId, void *arg);
58 static bool REGRESS_exec_check_perms(List *rangeTabls, bool do_abort);
59 static void REGRESS_utility_command(PlannedStmt *pstmt,
60  const char *queryString, bool readOnlyTree,
61  ProcessUtilityContext context,
62  ParamListInfo params,
63  QueryEnvironment *queryEnv,
65 
66 /* Helper functions */
67 static const char *nodetag_to_string(NodeTag tag);
68 static char *accesstype_to_string(ObjectAccessType access, int subId);
69 static char *accesstype_arg_to_string(ObjectAccessType access, void *arg);
70 
71 
72 void _PG_init(void);
73 
74 /*
75  * Module load callback
76  */
77 void
78 _PG_init(void)
79 {
80  /*
81  * test_oat_hooks.deny_set_variable = (on|off)
82  */
83  DefineCustomBoolVariable("test_oat_hooks.deny_set_variable",
84  "Deny non-superuser set permissions",
85  NULL,
87  false,
88  PGC_SUSET,
90  NULL,
91  NULL,
92  NULL);
93 
94  /*
95  * test_oat_hooks.deny_alter_system = (on|off)
96  */
97  DefineCustomBoolVariable("test_oat_hooks.deny_alter_system",
98  "Deny non-superuser alter system set permissions",
99  NULL,
101  false,
102  PGC_SUSET,
104  NULL,
105  NULL,
106  NULL);
107 
108  /*
109  * test_oat_hooks.deny_object_access = (on|off)
110  */
111  DefineCustomBoolVariable("test_oat_hooks.deny_object_access",
112  "Deny non-superuser object access permissions",
113  NULL,
115  false,
116  PGC_SUSET,
118  NULL,
119  NULL,
120  NULL);
121 
122  /*
123  * test_oat_hooks.deny_exec_perms = (on|off)
124  */
125  DefineCustomBoolVariable("test_oat_hooks.deny_exec_perms",
126  "Deny non-superuser exec permissions",
127  NULL,
129  false,
130  PGC_SUSET,
132  NULL,
133  NULL,
134  NULL);
135 
136  /*
137  * test_oat_hooks.deny_utility_commands = (on|off)
138  */
139  DefineCustomBoolVariable("test_oat_hooks.deny_utility_commands",
140  "Deny non-superuser utility commands",
141  NULL,
143  false,
144  PGC_SUSET,
146  NULL,
147  NULL,
148  NULL);
149 
150  /*
151  * test_oat_hooks.audit = (on|off)
152  */
153  DefineCustomBoolVariable("test_oat_hooks.audit",
154  "Turn on/off debug audit messages",
155  NULL,
156  &REGRESS_audit,
157  false,
158  PGC_SUSET,
160  NULL,
161  NULL,
162  NULL);
163 
164  /*
165  * test_oat_hooks.user_var{1,2} = (on|off)
166  */
167  DefineCustomBoolVariable("test_oat_hooks.user_var1",
168  "Dummy parameter settable by public",
169  NULL,
171  false,
172  PGC_USERSET,
174  NULL,
175  NULL,
176  NULL);
177 
178  DefineCustomBoolVariable("test_oat_hooks.user_var2",
179  "Dummy parameter settable by public",
180  NULL,
182  false,
183  PGC_USERSET,
185  NULL,
186  NULL,
187  NULL);
188 
189  /*
190  * test_oat_hooks.super_var{1,2} = (on|off)
191  */
192  DefineCustomBoolVariable("test_oat_hooks.super_var1",
193  "Dummy parameter settable by superuser",
194  NULL,
196  false,
197  PGC_SUSET,
199  NULL,
200  NULL,
201  NULL);
202 
203  DefineCustomBoolVariable("test_oat_hooks.super_var2",
204  "Dummy parameter settable by superuser",
205  NULL,
207  false,
208  PGC_SUSET,
210  NULL,
211  NULL,
212  NULL);
213 
214  MarkGUCPrefixReserved("test_oat_hooks");
215 
216  /* Object access hook */
219 
220  /* Object access hook str */
223 
224  /* DML permission check */
227 
228  /* ProcessUtility hook */
231 }
232 
233 static void
234 emit_audit_message(const char *type, const char *hook, char *action, char *objName)
235 {
236  /*
237  * Ensure that audit messages are not duplicated by only emitting them
238  * from a leader process, not a worker process. This makes the test
239  * results deterministic even if run with force_parallel_mode = regress.
240  */
242  {
243  const char *who = superuser_arg(GetUserId()) ? "superuser" : "non-superuser";
244 
245  if (objName)
246  ereport(NOTICE,
247  (errcode(ERRCODE_INTERNAL_ERROR),
248  errmsg("in %s: %s %s %s [%s]", hook, who, type, action, objName)));
249  else
250  ereport(NOTICE,
251  (errcode(ERRCODE_INTERNAL_ERROR),
252  errmsg("in %s: %s %s %s", hook, who, type, action)));
253  }
254 
255  if (action)
256  pfree(action);
257  if (objName)
258  pfree(objName);
259 }
260 
261 static void
262 audit_attempt(const char *hook, char *action, char *objName)
263 {
264  emit_audit_message("attempting", hook, action, objName);
265 }
266 
267 static void
268 audit_success(const char *hook, char *action, char *objName)
269 {
270  emit_audit_message("finished", hook, action, objName);
271 }
272 
273 static void
274 audit_failure(const char *hook, char *action, char *objName)
275 {
276  emit_audit_message("denied", hook, action, objName);
277 }
278 
279 static void
280 REGRESS_object_access_hook_str(ObjectAccessType access, Oid classId, const char *objName, int subId, void *arg)
281 {
282  audit_attempt("object_access_hook_str",
283  accesstype_to_string(access, subId),
284  pstrdup(objName));
285 
287  {
288  (*next_object_access_hook_str) (access, classId, objName, subId, arg);
289  }
290 
291  switch (access)
292  {
293  case OAT_POST_ALTER:
294  if ((subId & ACL_SET) && (subId & ACL_ALTER_SYSTEM))
295  {
297  ereport(ERROR,
298  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
299  errmsg("permission denied: all privileges %s", objName)));
300  }
301  else if (subId & ACL_SET)
302  {
304  ereport(ERROR,
305  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
306  errmsg("permission denied: set %s", objName)));
307  }
308  else if (subId & ACL_ALTER_SYSTEM)
309  {
311  ereport(ERROR,
312  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
313  errmsg("permission denied: alter system set %s", objName)));
314  }
315  else
316  elog(ERROR, "Unknown ParameterAclRelationId subId: %d", subId);
317  break;
318  default:
319  break;
320  }
321 
322  audit_success("object_access_hook_str",
323  accesstype_to_string(access, subId),
324  pstrdup(objName));
325 }
326 
327 static void
328 REGRESS_object_access_hook(ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
329 {
330  audit_attempt("object access",
331  accesstype_to_string(access, 0),
332  accesstype_arg_to_string(access, arg));
333 
335  ereport(ERROR,
336  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
337  errmsg("permission denied: %s [%s]",
338  accesstype_to_string(access, 0),
339  accesstype_arg_to_string(access, arg))));
340 
341  /* Forward to next hook in the chain */
343  (*next_object_access_hook) (access, classId, objectId, subId, arg);
344 
345  audit_success("object access",
346  accesstype_to_string(access, 0),
347  accesstype_arg_to_string(access, arg));
348 }
349 
350 static bool
351 REGRESS_exec_check_perms(List *rangeTabls, bool do_abort)
352 {
353  bool am_super = superuser_arg(GetUserId());
354  bool allow = true;
355 
356  audit_attempt("executor check perms", pstrdup("execute"), NULL);
357 
358  /* Perform our check */
359  allow = !REGRESS_deny_exec_perms || am_super;
360  if (do_abort && !allow)
361  ereport(ERROR,
362  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
363  errmsg("permission denied: %s", "execute")));
364 
365  /* Forward to next hook in the chain */
367  !(*next_exec_check_perms_hook) (rangeTabls, do_abort))
368  allow = false;
369 
370  if (allow)
371  audit_success("executor check perms",
372  pstrdup("execute"),
373  NULL);
374  else
375  audit_failure("executor check perms",
376  pstrdup("execute"),
377  NULL);
378 
379  return allow;
380 }
381 
382 static void
384  const char *queryString,
385  bool readOnlyTree,
386  ProcessUtilityContext context,
387  ParamListInfo params,
388  QueryEnvironment *queryEnv,
390  QueryCompletion *qc)
391 {
392  Node *parsetree = pstmt->utilityStmt;
393 
394  const char *action;
395  NodeTag tag = nodeTag(parsetree);
396 
397  switch (tag)
398  {
399  case T_VariableSetStmt:
400  action = "set";
401  break;
402  case T_AlterSystemStmt:
403  action = "alter system";
404  break;
405  case T_LoadStmt:
406  action = "load";
407  break;
408  default:
409  action = nodetag_to_string(tag);
410  break;
411  }
412 
413  audit_attempt("process utility",
414  pstrdup(action),
415  NULL);
416 
417  /* Check permissions */
419  ereport(ERROR,
420  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
421  errmsg("permission denied: %s", action)));
422 
423  /* Forward to next hook in the chain */
425  (*next_ProcessUtility_hook) (pstmt, queryString, readOnlyTree,
426  context, params, queryEnv,
427  dest, qc);
428  else
429  standard_ProcessUtility(pstmt, queryString, readOnlyTree,
430  context, params, queryEnv,
431  dest, qc);
432 
433  /* We're done */
434  audit_success("process utility",
435  pstrdup(action),
436  NULL);
437 }
438 
439 static const char *
441 {
442  switch (tag)
443  {
444  case T_Invalid:
445  return "Invalid";
446  break;
447  case T_IndexInfo:
448  return "IndexInfo";
449  break;
450  case T_ExprContext:
451  return "ExprContext";
452  break;
453  case T_ProjectionInfo:
454  return "ProjectionInfo";
455  break;
456  case T_JunkFilter:
457  return "JunkFilter";
458  break;
460  return "OnConflictSetState";
461  break;
462  case T_ResultRelInfo:
463  return "ResultRelInfo";
464  break;
465  case T_EState:
466  return "EState";
467  break;
468  case T_TupleTableSlot:
469  return "TupleTableSlot";
470  break;
471  case T_Plan:
472  return "Plan";
473  break;
474  case T_Result:
475  return "Result";
476  break;
477  case T_ProjectSet:
478  return "ProjectSet";
479  break;
480  case T_ModifyTable:
481  return "ModifyTable";
482  break;
483  case T_Append:
484  return "Append";
485  break;
486  case T_MergeAppend:
487  return "MergeAppend";
488  break;
489  case T_RecursiveUnion:
490  return "RecursiveUnion";
491  break;
492  case T_BitmapAnd:
493  return "BitmapAnd";
494  break;
495  case T_BitmapOr:
496  return "BitmapOr";
497  break;
498  case T_Scan:
499  return "Scan";
500  break;
501  case T_SeqScan:
502  return "SeqScan";
503  break;
504  case T_SampleScan:
505  return "SampleScan";
506  break;
507  case T_IndexScan:
508  return "IndexScan";
509  break;
510  case T_IndexOnlyScan:
511  return "IndexOnlyScan";
512  break;
513  case T_BitmapIndexScan:
514  return "BitmapIndexScan";
515  break;
516  case T_BitmapHeapScan:
517  return "BitmapHeapScan";
518  break;
519  case T_TidScan:
520  return "TidScan";
521  break;
522  case T_TidRangeScan:
523  return "TidRangeScan";
524  break;
525  case T_SubqueryScan:
526  return "SubqueryScan";
527  break;
528  case T_FunctionScan:
529  return "FunctionScan";
530  break;
531  case T_ValuesScan:
532  return "ValuesScan";
533  break;
534  case T_TableFuncScan:
535  return "TableFuncScan";
536  break;
537  case T_CteScan:
538  return "CteScan";
539  break;
541  return "NamedTuplestoreScan";
542  break;
543  case T_WorkTableScan:
544  return "WorkTableScan";
545  break;
546  case T_ForeignScan:
547  return "ForeignScan";
548  break;
549  case T_CustomScan:
550  return "CustomScan";
551  break;
552  case T_Join:
553  return "Join";
554  break;
555  case T_NestLoop:
556  return "NestLoop";
557  break;
558  case T_MergeJoin:
559  return "MergeJoin";
560  break;
561  case T_HashJoin:
562  return "HashJoin";
563  break;
564  case T_Material:
565  return "Material";
566  break;
567  case T_Memoize:
568  return "Memoize";
569  break;
570  case T_Sort:
571  return "Sort";
572  break;
573  case T_IncrementalSort:
574  return "IncrementalSort";
575  break;
576  case T_Group:
577  return "Group";
578  break;
579  case T_Agg:
580  return "Agg";
581  break;
582  case T_WindowAgg:
583  return "WindowAgg";
584  break;
585  case T_Unique:
586  return "Unique";
587  break;
588  case T_Gather:
589  return "Gather";
590  break;
591  case T_GatherMerge:
592  return "GatherMerge";
593  break;
594  case T_Hash:
595  return "Hash";
596  break;
597  case T_SetOp:
598  return "SetOp";
599  break;
600  case T_LockRows:
601  return "LockRows";
602  break;
603  case T_Limit:
604  return "Limit";
605  break;
606  case T_NestLoopParam:
607  return "NestLoopParam";
608  break;
609  case T_PlanRowMark:
610  return "PlanRowMark";
611  break;
613  return "PartitionPruneInfo";
614  break;
616  return "PartitionedRelPruneInfo";
617  break;
619  return "PartitionPruneStepOp";
620  break;
622  return "PartitionPruneStepCombine";
623  break;
624  case T_PlanInvalItem:
625  return "PlanInvalItem";
626  break;
627  case T_PlanState:
628  return "PlanState";
629  break;
630  case T_ResultState:
631  return "ResultState";
632  break;
633  case T_ProjectSetState:
634  return "ProjectSetState";
635  break;
636  case T_ModifyTableState:
637  return "ModifyTableState";
638  break;
639  case T_AppendState:
640  return "AppendState";
641  break;
642  case T_MergeAppendState:
643  return "MergeAppendState";
644  break;
646  return "RecursiveUnionState";
647  break;
648  case T_BitmapAndState:
649  return "BitmapAndState";
650  break;
651  case T_BitmapOrState:
652  return "BitmapOrState";
653  break;
654  case T_ScanState:
655  return "ScanState";
656  break;
657  case T_SeqScanState:
658  return "SeqScanState";
659  break;
660  case T_SampleScanState:
661  return "SampleScanState";
662  break;
663  case T_IndexScanState:
664  return "IndexScanState";
665  break;
667  return "IndexOnlyScanState";
668  break;
670  return "BitmapIndexScanState";
671  break;
673  return "BitmapHeapScanState";
674  break;
675  case T_TidScanState:
676  return "TidScanState";
677  break;
678  case T_TidRangeScanState:
679  return "TidRangeScanState";
680  break;
681  case T_SubqueryScanState:
682  return "SubqueryScanState";
683  break;
684  case T_FunctionScanState:
685  return "FunctionScanState";
686  break;
688  return "TableFuncScanState";
689  break;
690  case T_ValuesScanState:
691  return "ValuesScanState";
692  break;
693  case T_CteScanState:
694  return "CteScanState";
695  break;
697  return "NamedTuplestoreScanState";
698  break;
700  return "WorkTableScanState";
701  break;
702  case T_ForeignScanState:
703  return "ForeignScanState";
704  break;
705  case T_CustomScanState:
706  return "CustomScanState";
707  break;
708  case T_JoinState:
709  return "JoinState";
710  break;
711  case T_NestLoopState:
712  return "NestLoopState";
713  break;
714  case T_MergeJoinState:
715  return "MergeJoinState";
716  break;
717  case T_HashJoinState:
718  return "HashJoinState";
719  break;
720  case T_MaterialState:
721  return "MaterialState";
722  break;
723  case T_MemoizeState:
724  return "MemoizeState";
725  break;
726  case T_SortState:
727  return "SortState";
728  break;
730  return "IncrementalSortState";
731  break;
732  case T_GroupState:
733  return "GroupState";
734  break;
735  case T_AggState:
736  return "AggState";
737  break;
738  case T_WindowAggState:
739  return "WindowAggState";
740  break;
741  case T_UniqueState:
742  return "UniqueState";
743  break;
744  case T_GatherState:
745  return "GatherState";
746  break;
747  case T_GatherMergeState:
748  return "GatherMergeState";
749  break;
750  case T_HashState:
751  return "HashState";
752  break;
753  case T_SetOpState:
754  return "SetOpState";
755  break;
756  case T_LockRowsState:
757  return "LockRowsState";
758  break;
759  case T_LimitState:
760  return "LimitState";
761  break;
762  case T_Alias:
763  return "Alias";
764  break;
765  case T_RangeVar:
766  return "RangeVar";
767  break;
768  case T_TableFunc:
769  return "TableFunc";
770  break;
771  case T_Var:
772  return "Var";
773  break;
774  case T_Const:
775  return "Const";
776  break;
777  case T_Param:
778  return "Param";
779  break;
780  case T_Aggref:
781  return "Aggref";
782  break;
783  case T_GroupingFunc:
784  return "GroupingFunc";
785  break;
786  case T_WindowFunc:
787  return "WindowFunc";
788  break;
789  case T_SubscriptingRef:
790  return "SubscriptingRef";
791  break;
792  case T_FuncExpr:
793  return "FuncExpr";
794  break;
795  case T_NamedArgExpr:
796  return "NamedArgExpr";
797  break;
798  case T_OpExpr:
799  return "OpExpr";
800  break;
801  case T_DistinctExpr:
802  return "DistinctExpr";
803  break;
804  case T_NullIfExpr:
805  return "NullIfExpr";
806  break;
807  case T_ScalarArrayOpExpr:
808  return "ScalarArrayOpExpr";
809  break;
810  case T_BoolExpr:
811  return "BoolExpr";
812  break;
813  case T_SubLink:
814  return "SubLink";
815  break;
816  case T_SubPlan:
817  return "SubPlan";
818  break;
820  return "AlternativeSubPlan";
821  break;
822  case T_FieldSelect:
823  return "FieldSelect";
824  break;
825  case T_FieldStore:
826  return "FieldStore";
827  break;
828  case T_RelabelType:
829  return "RelabelType";
830  break;
831  case T_CoerceViaIO:
832  return "CoerceViaIO";
833  break;
834  case T_ArrayCoerceExpr:
835  return "ArrayCoerceExpr";
836  break;
838  return "ConvertRowtypeExpr";
839  break;
840  case T_CollateExpr:
841  return "CollateExpr";
842  break;
843  case T_CaseExpr:
844  return "CaseExpr";
845  break;
846  case T_CaseWhen:
847  return "CaseWhen";
848  break;
849  case T_CaseTestExpr:
850  return "CaseTestExpr";
851  break;
852  case T_ArrayExpr:
853  return "ArrayExpr";
854  break;
855  case T_RowExpr:
856  return "RowExpr";
857  break;
858  case T_RowCompareExpr:
859  return "RowCompareExpr";
860  break;
861  case T_CoalesceExpr:
862  return "CoalesceExpr";
863  break;
864  case T_MinMaxExpr:
865  return "MinMaxExpr";
866  break;
867  case T_SQLValueFunction:
868  return "SQLValueFunction";
869  break;
870  case T_XmlExpr:
871  return "XmlExpr";
872  break;
873  case T_NullTest:
874  return "NullTest";
875  break;
876  case T_BooleanTest:
877  return "BooleanTest";
878  break;
879  case T_CoerceToDomain:
880  return "CoerceToDomain";
881  break;
883  return "CoerceToDomainValue";
884  break;
885  case T_SetToDefault:
886  return "SetToDefault";
887  break;
888  case T_CurrentOfExpr:
889  return "CurrentOfExpr";
890  break;
891  case T_NextValueExpr:
892  return "NextValueExpr";
893  break;
894  case T_InferenceElem:
895  return "InferenceElem";
896  break;
897  case T_TargetEntry:
898  return "TargetEntry";
899  break;
900  case T_RangeTblRef:
901  return "RangeTblRef";
902  break;
903  case T_JoinExpr:
904  return "JoinExpr";
905  break;
906  case T_FromExpr:
907  return "FromExpr";
908  break;
909  case T_OnConflictExpr:
910  return "OnConflictExpr";
911  break;
912  case T_IntoClause:
913  return "IntoClause";
914  break;
915  case T_ExprState:
916  return "ExprState";
917  break;
919  return "WindowFuncExprState";
920  break;
921  case T_SetExprState:
922  return "SetExprState";
923  break;
924  case T_SubPlanState:
925  return "SubPlanState";
926  break;
928  return "DomainConstraintState";
929  break;
930  case T_PlannerInfo:
931  return "PlannerInfo";
932  break;
933  case T_PlannerGlobal:
934  return "PlannerGlobal";
935  break;
936  case T_RelOptInfo:
937  return "RelOptInfo";
938  break;
939  case T_IndexOptInfo:
940  return "IndexOptInfo";
941  break;
942  case T_ForeignKeyOptInfo:
943  return "ForeignKeyOptInfo";
944  break;
945  case T_ParamPathInfo:
946  return "ParamPathInfo";
947  break;
948  case T_Path:
949  return "Path";
950  break;
951  case T_IndexPath:
952  return "IndexPath";
953  break;
954  case T_BitmapHeapPath:
955  return "BitmapHeapPath";
956  break;
957  case T_BitmapAndPath:
958  return "BitmapAndPath";
959  break;
960  case T_BitmapOrPath:
961  return "BitmapOrPath";
962  break;
963  case T_TidPath:
964  return "TidPath";
965  break;
966  case T_TidRangePath:
967  return "TidRangePath";
968  break;
969  case T_SubqueryScanPath:
970  return "SubqueryScanPath";
971  break;
972  case T_ForeignPath:
973  return "ForeignPath";
974  break;
975  case T_CustomPath:
976  return "CustomPath";
977  break;
978  case T_NestPath:
979  return "NestPath";
980  break;
981  case T_MergePath:
982  return "MergePath";
983  break;
984  case T_HashPath:
985  return "HashPath";
986  break;
987  case T_AppendPath:
988  return "AppendPath";
989  break;
990  case T_MergeAppendPath:
991  return "MergeAppendPath";
992  break;
993  case T_GroupResultPath:
994  return "GroupResultPath";
995  break;
996  case T_MaterialPath:
997  return "MaterialPath";
998  break;
999  case T_MemoizePath:
1000  return "MemoizePath";
1001  break;
1002  case T_UniquePath:
1003  return "UniquePath";
1004  break;
1005  case T_GatherPath:
1006  return "GatherPath";
1007  break;
1008  case T_GatherMergePath:
1009  return "GatherMergePath";
1010  break;
1011  case T_ProjectionPath:
1012  return "ProjectionPath";
1013  break;
1014  case T_ProjectSetPath:
1015  return "ProjectSetPath";
1016  break;
1017  case T_SortPath:
1018  return "SortPath";
1019  break;
1020  case T_IncrementalSortPath:
1021  return "IncrementalSortPath";
1022  break;
1023  case T_GroupPath:
1024  return "GroupPath";
1025  break;
1026  case T_UpperUniquePath:
1027  return "UpperUniquePath";
1028  break;
1029  case T_AggPath:
1030  return "AggPath";
1031  break;
1032  case T_GroupingSetsPath:
1033  return "GroupingSetsPath";
1034  break;
1035  case T_MinMaxAggPath:
1036  return "MinMaxAggPath";
1037  break;
1038  case T_WindowAggPath:
1039  return "WindowAggPath";
1040  break;
1041  case T_SetOpPath:
1042  return "SetOpPath";
1043  break;
1044  case T_RecursiveUnionPath:
1045  return "RecursiveUnionPath";
1046  break;
1047  case T_LockRowsPath:
1048  return "LockRowsPath";
1049  break;
1050  case T_ModifyTablePath:
1051  return "ModifyTablePath";
1052  break;
1053  case T_LimitPath:
1054  return "LimitPath";
1055  break;
1056  case T_EquivalenceClass:
1057  return "EquivalenceClass";
1058  break;
1059  case T_EquivalenceMember:
1060  return "EquivalenceMember";
1061  break;
1062  case T_PathKey:
1063  return "PathKey";
1064  break;
1065  case T_PathTarget:
1066  return "PathTarget";
1067  break;
1068  case T_RestrictInfo:
1069  return "RestrictInfo";
1070  break;
1071  case T_IndexClause:
1072  return "IndexClause";
1073  break;
1074  case T_PlaceHolderVar:
1075  return "PlaceHolderVar";
1076  break;
1077  case T_SpecialJoinInfo:
1078  return "SpecialJoinInfo";
1079  break;
1080  case T_AppendRelInfo:
1081  return "AppendRelInfo";
1082  break;
1083  case T_RowIdentityVarInfo:
1084  return "RowIdentityVarInfo";
1085  break;
1086  case T_PlaceHolderInfo:
1087  return "PlaceHolderInfo";
1088  break;
1089  case T_MinMaxAggInfo:
1090  return "MinMaxAggInfo";
1091  break;
1092  case T_PlannerParamItem:
1093  return "PlannerParamItem";
1094  break;
1095  case T_RollupData:
1096  return "RollupData";
1097  break;
1098  case T_GroupingSetData:
1099  return "GroupingSetData";
1100  break;
1101  case T_StatisticExtInfo:
1102  return "StatisticExtInfo";
1103  break;
1104  case T_AllocSetContext:
1105  return "AllocSetContext";
1106  break;
1107  case T_SlabContext:
1108  return "SlabContext";
1109  break;
1110  case T_GenerationContext:
1111  return "GenerationContext";
1112  break;
1113  case T_Integer:
1114  return "Integer";
1115  break;
1116  case T_Float:
1117  return "Float";
1118  break;
1119  case T_Boolean:
1120  return "Boolean";
1121  break;
1122  case T_String:
1123  return "String";
1124  break;
1125  case T_BitString:
1126  return "BitString";
1127  break;
1128  case T_List:
1129  return "List";
1130  break;
1131  case T_IntList:
1132  return "IntList";
1133  break;
1134  case T_OidList:
1135  return "OidList";
1136  break;
1137  case T_ExtensibleNode:
1138  return "ExtensibleNode";
1139  break;
1140  case T_RawStmt:
1141  return "RawStmt";
1142  break;
1143  case T_Query:
1144  return "Query";
1145  break;
1146  case T_PlannedStmt:
1147  return "PlannedStmt";
1148  break;
1149  case T_InsertStmt:
1150  return "InsertStmt";
1151  break;
1152  case T_DeleteStmt:
1153  return "DeleteStmt";
1154  break;
1155  case T_UpdateStmt:
1156  return "UpdateStmt";
1157  break;
1158  case T_SelectStmt:
1159  return "SelectStmt";
1160  break;
1161  case T_ReturnStmt:
1162  return "ReturnStmt";
1163  break;
1164  case T_PLAssignStmt:
1165  return "PLAssignStmt";
1166  break;
1167  case T_AlterTableStmt:
1168  return "AlterTableStmt";
1169  break;
1170  case T_AlterTableCmd:
1171  return "AlterTableCmd";
1172  break;
1173  case T_AlterDomainStmt:
1174  return "AlterDomainStmt";
1175  break;
1176  case T_SetOperationStmt:
1177  return "SetOperationStmt";
1178  break;
1179  case T_GrantStmt:
1180  return "GrantStmt";
1181  break;
1182  case T_GrantRoleStmt:
1183  return "GrantRoleStmt";
1184  break;
1186  return "AlterDefaultPrivilegesStmt";
1187  break;
1188  case T_ClosePortalStmt:
1189  return "ClosePortalStmt";
1190  break;
1191  case T_ClusterStmt:
1192  return "ClusterStmt";
1193  break;
1194  case T_CopyStmt:
1195  return "CopyStmt";
1196  break;
1197  case T_CreateStmt:
1198  return "CreateStmt";
1199  break;
1200  case T_DefineStmt:
1201  return "DefineStmt";
1202  break;
1203  case T_DropStmt:
1204  return "DropStmt";
1205  break;
1206  case T_TruncateStmt:
1207  return "TruncateStmt";
1208  break;
1209  case T_CommentStmt:
1210  return "CommentStmt";
1211  break;
1212  case T_FetchStmt:
1213  return "FetchStmt";
1214  break;
1215  case T_IndexStmt:
1216  return "IndexStmt";
1217  break;
1218  case T_CreateFunctionStmt:
1219  return "CreateFunctionStmt";
1220  break;
1221  case T_AlterFunctionStmt:
1222  return "AlterFunctionStmt";
1223  break;
1224  case T_DoStmt:
1225  return "DoStmt";
1226  break;
1227  case T_RenameStmt:
1228  return "RenameStmt";
1229  break;
1230  case T_RuleStmt:
1231  return "RuleStmt";
1232  break;
1233  case T_NotifyStmt:
1234  return "NotifyStmt";
1235  break;
1236  case T_ListenStmt:
1237  return "ListenStmt";
1238  break;
1239  case T_UnlistenStmt:
1240  return "UnlistenStmt";
1241  break;
1242  case T_TransactionStmt:
1243  return "TransactionStmt";
1244  break;
1245  case T_ViewStmt:
1246  return "ViewStmt";
1247  break;
1248  case T_LoadStmt:
1249  return "LoadStmt";
1250  break;
1251  case T_CreateDomainStmt:
1252  return "CreateDomainStmt";
1253  break;
1254  case T_CreatedbStmt:
1255  return "CreatedbStmt";
1256  break;
1257  case T_DropdbStmt:
1258  return "DropdbStmt";
1259  break;
1260  case T_VacuumStmt:
1261  return "VacuumStmt";
1262  break;
1263  case T_ExplainStmt:
1264  return "ExplainStmt";
1265  break;
1266  case T_CreateTableAsStmt:
1267  return "CreateTableAsStmt";
1268  break;
1269  case T_CreateSeqStmt:
1270  return "CreateSeqStmt";
1271  break;
1272  case T_AlterSeqStmt:
1273  return "AlterSeqStmt";
1274  break;
1275  case T_VariableSetStmt:
1276  return "VariableSetStmt";
1277  break;
1278  case T_VariableShowStmt:
1279  return "VariableShowStmt";
1280  break;
1281  case T_DiscardStmt:
1282  return "DiscardStmt";
1283  break;
1284  case T_CreateTrigStmt:
1285  return "CreateTrigStmt";
1286  break;
1287  case T_CreatePLangStmt:
1288  return "CreatePLangStmt";
1289  break;
1290  case T_CreateRoleStmt:
1291  return "CreateRoleStmt";
1292  break;
1293  case T_AlterRoleStmt:
1294  return "AlterRoleStmt";
1295  break;
1296  case T_DropRoleStmt:
1297  return "DropRoleStmt";
1298  break;
1299  case T_LockStmt:
1300  return "LockStmt";
1301  break;
1302  case T_ConstraintsSetStmt:
1303  return "ConstraintsSetStmt";
1304  break;
1305  case T_ReindexStmt:
1306  return "ReindexStmt";
1307  break;
1308  case T_CheckPointStmt:
1309  return "CheckPointStmt";
1310  break;
1311  case T_CreateSchemaStmt:
1312  return "CreateSchemaStmt";
1313  break;
1314  case T_AlterDatabaseStmt:
1315  return "AlterDatabaseStmt";
1316  break;
1318  return "AlterDatabaseRefreshCollStmt";
1319  break;
1321  return "AlterDatabaseSetStmt";
1322  break;
1323  case T_AlterRoleSetStmt:
1324  return "AlterRoleSetStmt";
1325  break;
1327  return "CreateConversionStmt";
1328  break;
1329  case T_CreateCastStmt:
1330  return "CreateCastStmt";
1331  break;
1332  case T_CreateOpClassStmt:
1333  return "CreateOpClassStmt";
1334  break;
1335  case T_CreateOpFamilyStmt:
1336  return "CreateOpFamilyStmt";
1337  break;
1338  case T_AlterOpFamilyStmt:
1339  return "AlterOpFamilyStmt";
1340  break;
1341  case T_PrepareStmt:
1342  return "PrepareStmt";
1343  break;
1344  case T_ExecuteStmt:
1345  return "ExecuteStmt";
1346  break;
1347  case T_DeallocateStmt:
1348  return "DeallocateStmt";
1349  break;
1350  case T_DeclareCursorStmt:
1351  return "DeclareCursorStmt";
1352  break;
1354  return "CreateTableSpaceStmt";
1355  break;
1356  case T_DropTableSpaceStmt:
1357  return "DropTableSpaceStmt";
1358  break;
1360  return "AlterObjectDependsStmt";
1361  break;
1363  return "AlterObjectSchemaStmt";
1364  break;
1365  case T_AlterOwnerStmt:
1366  return "AlterOwnerStmt";
1367  break;
1368  case T_AlterOperatorStmt:
1369  return "AlterOperatorStmt";
1370  break;
1371  case T_AlterTypeStmt:
1372  return "AlterTypeStmt";
1373  break;
1374  case T_DropOwnedStmt:
1375  return "DropOwnedStmt";
1376  break;
1377  case T_ReassignOwnedStmt:
1378  return "ReassignOwnedStmt";
1379  break;
1380  case T_CompositeTypeStmt:
1381  return "CompositeTypeStmt";
1382  break;
1383  case T_CreateEnumStmt:
1384  return "CreateEnumStmt";
1385  break;
1386  case T_CreateRangeStmt:
1387  return "CreateRangeStmt";
1388  break;
1389  case T_AlterEnumStmt:
1390  return "AlterEnumStmt";
1391  break;
1393  return "AlterTSDictionaryStmt";
1394  break;
1396  return "AlterTSConfigurationStmt";
1397  break;
1398  case T_CreateFdwStmt:
1399  return "CreateFdwStmt";
1400  break;
1401  case T_AlterFdwStmt:
1402  return "AlterFdwStmt";
1403  break;
1405  return "CreateForeignServerStmt";
1406  break;
1408  return "AlterForeignServerStmt";
1409  break;
1411  return "CreateUserMappingStmt";
1412  break;
1414  return "AlterUserMappingStmt";
1415  break;
1416  case T_DropUserMappingStmt:
1417  return "DropUserMappingStmt";
1418  break;
1420  return "AlterTableSpaceOptionsStmt";
1421  break;
1423  return "AlterTableMoveAllStmt";
1424  break;
1425  case T_SecLabelStmt:
1426  return "SecLabelStmt";
1427  break;
1429  return "CreateForeignTableStmt";
1430  break;
1432  return "ImportForeignSchemaStmt";
1433  break;
1434  case T_CreateExtensionStmt:
1435  return "CreateExtensionStmt";
1436  break;
1437  case T_AlterExtensionStmt:
1438  return "AlterExtensionStmt";
1439  break;
1441  return "AlterExtensionContentsStmt";
1442  break;
1443  case T_CreateEventTrigStmt:
1444  return "CreateEventTrigStmt";
1445  break;
1446  case T_AlterEventTrigStmt:
1447  return "AlterEventTrigStmt";
1448  break;
1449  case T_RefreshMatViewStmt:
1450  return "RefreshMatViewStmt";
1451  break;
1452  case T_ReplicaIdentityStmt:
1453  return "ReplicaIdentityStmt";
1454  break;
1455  case T_AlterSystemStmt:
1456  return "AlterSystemStmt";
1457  break;
1458  case T_CreatePolicyStmt:
1459  return "CreatePolicyStmt";
1460  break;
1461  case T_AlterPolicyStmt:
1462  return "AlterPolicyStmt";
1463  break;
1464  case T_CreateTransformStmt:
1465  return "CreateTransformStmt";
1466  break;
1467  case T_CreateAmStmt:
1468  return "CreateAmStmt";
1469  break;
1471  return "CreatePublicationStmt";
1472  break;
1474  return "AlterPublicationStmt";
1475  break;
1477  return "CreateSubscriptionStmt";
1478  break;
1480  return "AlterSubscriptionStmt";
1481  break;
1483  return "DropSubscriptionStmt";
1484  break;
1485  case T_CreateStatsStmt:
1486  return "CreateStatsStmt";
1487  break;
1488  case T_AlterCollationStmt:
1489  return "AlterCollationStmt";
1490  break;
1491  case T_CallStmt:
1492  return "CallStmt";
1493  break;
1494  case T_AlterStatsStmt:
1495  return "AlterStatsStmt";
1496  break;
1497  case T_A_Expr:
1498  return "A_Expr";
1499  break;
1500  case T_ColumnRef:
1501  return "ColumnRef";
1502  break;
1503  case T_ParamRef:
1504  return "ParamRef";
1505  break;
1506  case T_A_Const:
1507  return "A_Const";
1508  break;
1509  case T_FuncCall:
1510  return "FuncCall";
1511  break;
1512  case T_A_Star:
1513  return "A_Star";
1514  break;
1515  case T_A_Indices:
1516  return "A_Indices";
1517  break;
1518  case T_A_Indirection:
1519  return "A_Indirection";
1520  break;
1521  case T_A_ArrayExpr:
1522  return "A_ArrayExpr";
1523  break;
1524  case T_ResTarget:
1525  return "ResTarget";
1526  break;
1527  case T_MultiAssignRef:
1528  return "MultiAssignRef";
1529  break;
1530  case T_TypeCast:
1531  return "TypeCast";
1532  break;
1533  case T_CollateClause:
1534  return "CollateClause";
1535  break;
1536  case T_SortBy:
1537  return "SortBy";
1538  break;
1539  case T_WindowDef:
1540  return "WindowDef";
1541  break;
1542  case T_RangeSubselect:
1543  return "RangeSubselect";
1544  break;
1545  case T_RangeFunction:
1546  return "RangeFunction";
1547  break;
1548  case T_RangeTableSample:
1549  return "RangeTableSample";
1550  break;
1551  case T_RangeTableFunc:
1552  return "RangeTableFunc";
1553  break;
1554  case T_RangeTableFuncCol:
1555  return "RangeTableFuncCol";
1556  break;
1557  case T_TypeName:
1558  return "TypeName";
1559  break;
1560  case T_ColumnDef:
1561  return "ColumnDef";
1562  break;
1563  case T_IndexElem:
1564  return "IndexElem";
1565  break;
1566  case T_StatsElem:
1567  return "StatsElem";
1568  break;
1569  case T_Constraint:
1570  return "Constraint";
1571  break;
1572  case T_DefElem:
1573  return "DefElem";
1574  break;
1575  case T_RangeTblEntry:
1576  return "RangeTblEntry";
1577  break;
1578  case T_RangeTblFunction:
1579  return "RangeTblFunction";
1580  break;
1581  case T_TableSampleClause:
1582  return "TableSampleClause";
1583  break;
1584  case T_WithCheckOption:
1585  return "WithCheckOption";
1586  break;
1587  case T_SortGroupClause:
1588  return "SortGroupClause";
1589  break;
1590  case T_GroupingSet:
1591  return "GroupingSet";
1592  break;
1593  case T_WindowClause:
1594  return "WindowClause";
1595  break;
1596  case T_ObjectWithArgs:
1597  return "ObjectWithArgs";
1598  break;
1599  case T_AccessPriv:
1600  return "AccessPriv";
1601  break;
1602  case T_CreateOpClassItem:
1603  return "CreateOpClassItem";
1604  break;
1605  case T_TableLikeClause:
1606  return "TableLikeClause";
1607  break;
1608  case T_FunctionParameter:
1609  return "FunctionParameter";
1610  break;
1611  case T_LockingClause:
1612  return "LockingClause";
1613  break;
1614  case T_RowMarkClause:
1615  return "RowMarkClause";
1616  break;
1617  case T_XmlSerialize:
1618  return "XmlSerialize";
1619  break;
1620  case T_WithClause:
1621  return "WithClause";
1622  break;
1623  case T_InferClause:
1624  return "InferClause";
1625  break;
1626  case T_OnConflictClause:
1627  return "OnConflictClause";
1628  break;
1629  case T_CTESearchClause:
1630  return "CTESearchClause";
1631  break;
1632  case T_CTECycleClause:
1633  return "CTECycleClause";
1634  break;
1635  case T_CommonTableExpr:
1636  return "CommonTableExpr";
1637  break;
1638  case T_RoleSpec:
1639  return "RoleSpec";
1640  break;
1641  case T_TriggerTransition:
1642  return "TriggerTransition";
1643  break;
1644  case T_PartitionElem:
1645  return "PartitionElem";
1646  break;
1647  case T_PartitionSpec:
1648  return "PartitionSpec";
1649  break;
1650  case T_PartitionBoundSpec:
1651  return "PartitionBoundSpec";
1652  break;
1653  case T_PartitionRangeDatum:
1654  return "PartitionRangeDatum";
1655  break;
1656  case T_PartitionCmd:
1657  return "PartitionCmd";
1658  break;
1659  case T_VacuumRelation:
1660  return "VacuumRelation";
1661  break;
1662  case T_PublicationObjSpec:
1663  return "PublicationObjSpec";
1664  break;
1665  case T_PublicationTable:
1666  return "PublicationTable";
1667  break;
1668  case T_IdentifySystemCmd:
1669  return "IdentifySystemCmd";
1670  break;
1671  case T_BaseBackupCmd:
1672  return "BaseBackupCmd";
1673  break;
1675  return "CreateReplicationSlotCmd";
1676  break;
1678  return "DropReplicationSlotCmd";
1679  break;
1681  return "ReadReplicationSlotCmd";
1682  break;
1683  case T_StartReplicationCmd:
1684  return "StartReplicationCmd";
1685  break;
1686  case T_TimeLineHistoryCmd:
1687  return "TimeLineHistoryCmd";
1688  break;
1689  case T_TriggerData:
1690  return "TriggerData";
1691  break;
1692  case T_EventTriggerData:
1693  return "EventTriggerData";
1694  break;
1695  case T_ReturnSetInfo:
1696  return "ReturnSetInfo";
1697  break;
1698  case T_WindowObjectData:
1699  return "WindowObjectData";
1700  break;
1701  case T_TIDBitmap:
1702  return "TIDBitmap";
1703  break;
1704  case T_InlineCodeBlock:
1705  return "InlineCodeBlock";
1706  break;
1707  case T_FdwRoutine:
1708  return "FdwRoutine";
1709  break;
1710  case T_IndexAmRoutine:
1711  return "IndexAmRoutine";
1712  break;
1713  case T_TableAmRoutine:
1714  return "TableAmRoutine";
1715  break;
1716  case T_TsmRoutine:
1717  return "TsmRoutine";
1718  break;
1719  case T_ForeignKeyCacheInfo:
1720  return "ForeignKeyCacheInfo";
1721  break;
1722  case T_CallContext:
1723  return "CallContext";
1724  break;
1726  return "SupportRequestSimplify";
1727  break;
1729  return "SupportRequestSelectivity";
1730  break;
1731  case T_SupportRequestCost:
1732  return "SupportRequestCost";
1733  break;
1734  case T_SupportRequestRows:
1735  return "SupportRequestRows";
1736  break;
1738  return "SupportRequestIndexCondition";
1739  break;
1740  default:
1741  break;
1742  }
1743  return "UNRECOGNIZED NodeTag";
1744 }
1745 
1746 static char *
1748 {
1749  const char *type;
1750 
1751  switch (access)
1752  {
1753  case OAT_POST_CREATE:
1754  type = "create";
1755  break;
1756  case OAT_DROP:
1757  type = "drop";
1758  break;
1759  case OAT_POST_ALTER:
1760  type = "alter";
1761  break;
1762  case OAT_NAMESPACE_SEARCH:
1763  type = "namespace search";
1764  break;
1765  case OAT_FUNCTION_EXECUTE:
1766  type = "execute";
1767  break;
1768  case OAT_TRUNCATE:
1769  type = "truncate";
1770  break;
1771  default:
1772  type = "UNRECOGNIZED ObjectAccessType";
1773  }
1774 
1775  if ((subId & ACL_SET) && (subId & ACL_ALTER_SYSTEM))
1776  return psprintf("%s (subId=0x%x, all privileges)", type, subId);
1777  if (subId & ACL_SET)
1778  return psprintf("%s (subId=0x%x, set)", type, subId);
1779  if (subId & ACL_ALTER_SYSTEM)
1780  return psprintf("%s (subId=0x%x, alter system)", type, subId);
1781 
1782  return psprintf("%s (subId=0x%x)", type, subId);
1783 }
1784 
1785 static char *
1787 {
1788  if (arg == NULL)
1789  return pstrdup("extra info null");
1790 
1791  switch (access)
1792  {
1793  case OAT_POST_CREATE:
1794  {
1796 
1797  return pstrdup(pc_arg->is_internal ? "internal" : "explicit");
1798  }
1799  break;
1800  case OAT_DROP:
1801  {
1802  ObjectAccessDrop *drop_arg = (ObjectAccessDrop *) arg;
1803 
1804  return psprintf("%s%s%s%s%s%s",
1805  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1806  ? "internal action," : ""),
1807  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1808  ? "concurrent drop," : ""),
1809  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1810  ? "suppress notices," : ""),
1811  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1812  ? "keep original object," : ""),
1813  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1814  ? "keep extensions," : ""),
1815  ((drop_arg->dropflags & PERFORM_DELETION_INTERNAL)
1816  ? "normal concurrent drop," : ""));
1817  }
1818  break;
1819  case OAT_POST_ALTER:
1820  {
1822 
1823  return psprintf("%s %s auxiliary object",
1824  (pa_arg->is_internal ? "internal" : "explicit"),
1825  (OidIsValid(pa_arg->auxiliary_id) ? "with" : "without"));
1826  }
1827  break;
1828  case OAT_NAMESPACE_SEARCH:
1829  {
1831 
1832  return psprintf("%s, %s",
1833  (ns_arg->ereport_on_violation ? "report on violation" : "no report on violation"),
1834  (ns_arg->result ? "allowed" : "denied"));
1835  }
1836  break;
1837  case OAT_TRUNCATE:
1838  case OAT_FUNCTION_EXECUTE:
1839  /* hook takes no arg. */
1840  return pstrdup("unexpected extra info pointer received");
1841  default:
1842  return pstrdup("cannot parse extra info for unrecognized access type");
1843  }
1844 
1845  return pstrdup("unknown");
1846 }
#define OidIsValid(objectId)
Definition: c.h:710
#define PERFORM_DELETION_INTERNAL
Definition: dependency.h:135
int errcode(int sqlerrcode)
Definition: elog.c:693
int errmsg(const char *fmt,...)
Definition: elog.c:904
#define ERROR
Definition: elog.h:33
#define elog(elevel,...)
Definition: elog.h:218
#define NOTICE
Definition: elog.h:29
#define ereport(elevel,...)
Definition: elog.h:143
ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
Definition: execMain.c:78
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
Definition: executor.h:84
void DefineCustomBoolVariable(const char *name, const char *short_desc, const char *long_desc, bool *valueAddr, bool bootValue, GucContext context, int flags, GucBoolCheckHook check_hook, GucBoolAssignHook assign_hook, GucShowHook show_hook)
Definition: guc.c:9482
void MarkGUCPrefixReserved(const char *className)
Definition: guc.c:9629
@ PGC_SUSET
Definition: guc.h:75
@ PGC_USERSET
Definition: guc.h:76
#define GUC_NOT_IN_SAMPLE
Definition: guc.h:213
#define IsParallelWorker()
Definition: parallel.h:61
char * pstrdup(const char *in)
Definition: mcxt.c:1305
void pfree(void *pointer)
Definition: mcxt.c:1175
Oid GetUserId(void)
Definition: miscinit.c:492
#define nodeTag(nodeptr)
Definition: nodes.h:578
NodeTag
Definition: nodes.h:27
@ T_LockingClause
Definition: nodes.h:491
@ T_Unique
Definition: nodes.h:84
@ T_HashJoinState
Definition: nodes.h:135
@ T_BitString
Definition: nodes.h:312
@ T_SupportRequestCost
Definition: nodes.h:561
@ T_RangeTblEntry
Definition: nodes.h:479
@ T_TIDBitmap
Definition: nodes.h:551
@ T_FieldStore
Definition: nodes.h:175
@ T_AlterPublicationStmt
Definition: nodes.h:441
@ T_AlternativeSubPlan
Definition: nodes.h:173
@ T_PartitionCmd
Definition: nodes.h:507
@ T_CoalesceExpr
Definition: nodes.h:187
@ T_CreateSchemaStmt
Definition: nodes.h:387
@ T_PathKey
Definition: nodes.h:281
@ T_PartitionPruneInfo
Definition: nodes.h:94
@ T_ModifyTablePath
Definition: nodes.h:276
@ T_RuleStmt
Definition: nodes.h:360
@ T_ExtensibleNode
Definition: nodes.h:324
@ T_SortPath
Definition: nodes.h:265
@ T_NamedTuplestoreScan
Definition: nodes.h:69
@ T_CreateRoleStmt
Definition: nodes.h:380
@ T_RangeVar
Definition: nodes.h:155
@ T_DoStmt
Definition: nodes.h:358
@ T_RangeTableFunc
Definition: nodes.h:471
@ T_Constraint
Definition: nodes.h:477
@ T_CreateStmt
Definition: nodes.h:349
@ T_WorkTableScanState
Definition: nodes.h:129
@ T_RangeFunction
Definition: nodes.h:469
@ T_OnConflictSetState
Definition: nodes.h:37
@ T_SubqueryScanPath
Definition: nodes.h:249
@ T_LoadStmt
Definition: nodes.h:366
@ T_GroupResultPath
Definition: nodes.h:257
@ T_CreateTrigStmt
Definition: nodes.h:378
@ T_XmlSerialize
Definition: nodes.h:493
@ T_MergeAppendState
Definition: nodes.h:110
@ T_DefElem
Definition: nodes.h:478
@ T_WithCheckOption
Definition: nodes.h:482
@ T_DomainConstraintState
Definition: nodes.h:231
@ T_ReindexStmt
Definition: nodes.h:385
@ T_SupportRequestSelectivity
Definition: nodes.h:560
@ T_AlterEnumStmt
Definition: nodes.h:413
@ T_List
Definition: nodes.h:317
@ T_ColumnDef
Definition: nodes.h:474
@ T_ExecuteStmt
Definition: nodes.h:398
@ T_PlannerParamItem
Definition: nodes.h:292
@ T_HashPath
Definition: nodes.h:254
@ T_CTESearchClause
Definition: nodes.h:497
@ T_IndexOnlyScanState
Definition: nodes.h:118
@ T_IndexOptInfo
Definition: nodes.h:239
@ T_OnConflictExpr
Definition: nodes.h:203
@ T_FdwRoutine
Definition: nodes.h:553
@ T_SubLink
Definition: nodes.h:171
@ T_RangeTblRef
Definition: nodes.h:200
@ T_SeqScanState
Definition: nodes.h:115
@ T_InferenceElem
Definition: nodes.h:198
@ T_ValuesScanState
Definition: nodes.h:126
@ T_CreateFdwStmt
Definition: nodes.h:416
@ T_RenameStmt
Definition: nodes.h:359
@ T_CreateEventTrigStmt
Definition: nodes.h:431
@ T_SortGroupClause
Definition: nodes.h:483
@ T_GroupPath
Definition: nodes.h:267
@ T_CoerceToDomainValue
Definition: nodes.h:194
@ T_ObjectWithArgs
Definition: nodes.h:486
@ T_DiscardStmt
Definition: nodes.h:377
@ T_WindowFunc
Definition: nodes.h:162
@ T_CustomScanState
Definition: nodes.h:131
@ T_ImportForeignSchemaStmt
Definition: nodes.h:427
@ T_FieldSelect
Definition: nodes.h:174
@ T_VacuumStmt
Definition: nodes.h:370
@ T_InlineCodeBlock
Definition: nodes.h:552
@ T_ArrayExpr
Definition: nodes.h:184
@ T_IdentifySystemCmd
Definition: nodes.h:531
@ T_TableFunc
Definition: nodes.h:156
@ T_TidRangeScan
Definition: nodes.h:63
@ T_AlterOperatorStmt
Definition: nodes.h:406
@ T_TableFuncScan
Definition: nodes.h:67
@ T_HashState
Definition: nodes.h:146
@ T_CollateExpr
Definition: nodes.h:180
@ T_CallContext
Definition: nodes.h:558
@ T_ReturnStmt
Definition: nodes.h:337
@ T_CreateTableSpaceStmt
Definition: nodes.h:401
@ T_DropRoleStmt
Definition: nodes.h:382
@ T_AlterTableSpaceOptionsStmt
Definition: nodes.h:423
@ T_PartitionElem
Definition: nodes.h:503
@ T_BoolExpr
Definition: nodes.h:170
@ T_MinMaxAggPath
Definition: nodes.h:271
@ T_AlterCollationStmt
Definition: nodes.h:446
@ T_RelOptInfo
Definition: nodes.h:238
@ T_AccessPriv
Definition: nodes.h:487
@ T_OpExpr
Definition: nodes.h:166
@ T_SupportRequestRows
Definition: nodes.h:562
@ T_CreateStatsStmt
Definition: nodes.h:445
@ T_CreateFunctionStmt
Definition: nodes.h:356
@ T_FunctionScan
Definition: nodes.h:65
@ T_TypeName
Definition: nodes.h:473
@ T_AlterDatabaseStmt
Definition: nodes.h:388
@ T_CreateSubscriptionStmt
Definition: nodes.h:442
@ T_PublicationObjSpec
Definition: nodes.h:509
@ T_SpecialJoinInfo
Definition: nodes.h:287
@ T_AlterRoleStmt
Definition: nodes.h:381
@ T_ExprContext
Definition: nodes.h:34
@ T_PathTarget
Definition: nodes.h:283
@ T_JoinExpr
Definition: nodes.h:201
@ T_ScalarArrayOpExpr
Definition: nodes.h:169
@ T_NestPath
Definition: nodes.h:252
@ T_CaseExpr
Definition: nodes.h:181
@ T_RelabelType
Definition: nodes.h:176
@ T_TupleTableSlot
Definition: nodes.h:41
@ T_CreatePublicationStmt
Definition: nodes.h:440
@ T_PlaceHolderInfo
Definition: nodes.h:290
@ T_PublicationTable
Definition: nodes.h:510
@ T_DeleteStmt
Definition: nodes.h:333
@ T_XmlExpr
Definition: nodes.h:190
@ T_CreateForeignTableStmt
Definition: nodes.h:426
@ T_ForeignKeyOptInfo
Definition: nodes.h:240
@ T_TidRangeScanState
Definition: nodes.h:122
@ T_GroupState
Definition: nodes.h:140
@ T_GroupingSet
Definition: nodes.h:484
@ T_AlterObjectDependsStmt
Definition: nodes.h:403
@ T_BitmapOr
Definition: nodes.h:54
@ T_CustomPath
Definition: nodes.h:251
@ T_CreateRangeStmt
Definition: nodes.h:412
@ T_Scan
Definition: nodes.h:55
@ T_CreateConversionStmt
Definition: nodes.h:392
@ T_Material
Definition: nodes.h:77
@ T_ExprState
Definition: nodes.h:227
@ T_ClusterStmt
Definition: nodes.h:347
@ T_SampleScanState
Definition: nodes.h:116
@ T_RawStmt
Definition: nodes.h:329
@ T_WindowObjectData
Definition: nodes.h:550
@ T_SupportRequestSimplify
Definition: nodes.h:559
@ T_DropOwnedStmt
Definition: nodes.h:408
@ T_IndexOnlyScan
Definition: nodes.h:59
@ T_FunctionParameter
Definition: nodes.h:490
@ T_TableSampleClause
Definition: nodes.h:481
@ T_Append
Definition: nodes.h:50
@ T_DropUserMappingStmt
Definition: nodes.h:422
@ T_SetOperationStmt
Definition: nodes.h:342
@ T_RestrictInfo
Definition: nodes.h:284
@ T_LockStmt
Definition: nodes.h:383
@ T_Gather
Definition: nodes.h:85
@ T_ListenStmt
Definition: nodes.h:362
@ T_BitmapIndexScan
Definition: nodes.h:60
@ T_Alias
Definition: nodes.h:154
@ T_ResTarget
Definition: nodes.h:462
@ T_SortState
Definition: nodes.h:138
@ T_PrepareStmt
Definition: nodes.h:397
@ T_MinMaxAggInfo
Definition: nodes.h:291
@ T_ReassignOwnedStmt
Definition: nodes.h:409
@ T_PartitionedRelPruneInfo
Definition: nodes.h:95
@ T_ConvertRowtypeExpr
Definition: nodes.h:179
@ T_RowIdentityVarInfo
Definition: nodes.h:289
@ T_AlterTypeStmt
Definition: nodes.h:407
@ T_BaseBackupCmd
Definition: nodes.h:532
@ T_IncrementalSortPath
Definition: nodes.h:266
@ T_CreateOpClassItem
Definition: nodes.h:488
@ T_RecursiveUnion
Definition: nodes.h:52
@ T_UpdateStmt
Definition: nodes.h:334
@ T_CommonTableExpr
Definition: nodes.h:499
@ T_IncrementalSortState
Definition: nodes.h:139
@ T_SubqueryScanState
Definition: nodes.h:123
@ T_TidPath
Definition: nodes.h:247
@ T_VariableShowStmt
Definition: nodes.h:376
@ T_TruncateStmt
Definition: nodes.h:352
@ T_PlanInvalItem
Definition: nodes.h:98
@ T_ExplainStmt
Definition: nodes.h:371
@ T_WindowClause
Definition: nodes.h:485
@ T_SetExprState
Definition: nodes.h:229
@ T_LockRows
Definition: nodes.h:89
@ T_CheckPointStmt
Definition: nodes.h:386
@ T_MultiAssignRef
Definition: nodes.h:463
@ T_EventTriggerData
Definition: nodes.h:548
@ T_DropdbStmt
Definition: nodes.h:369
@ T_StatsElem
Definition: nodes.h:476
@ T_Hash
Definition: nodes.h:87
@ T_ResultRelInfo
Definition: nodes.h:39
@ T_NotifyStmt
Definition: nodes.h:361
@ T_TidScan
Definition: nodes.h:62
@ T_ProjectionInfo
Definition: nodes.h:35
@ T_CteScanState
Definition: nodes.h:127
@ T_ResultState
Definition: nodes.h:106
@ T_AggPath
Definition: nodes.h:269
@ T_BitmapHeapScanState
Definition: nodes.h:120
@ T_Limit
Definition: nodes.h:90
@ T_Plan
Definition: nodes.h:46
@ T_CreateSeqStmt
Definition: nodes.h:373
@ T_PlanRowMark
Definition: nodes.h:93
@ T_A_Indices
Definition: nodes.h:459
@ T_StatisticExtInfo
Definition: nodes.h:295
@ T_MemoizePath
Definition: nodes.h:259
@ T_AlterForeignServerStmt
Definition: nodes.h:419
@ T_RecursiveUnionState
Definition: nodes.h:111
@ T_MaterialState
Definition: nodes.h:136
@ T_CreateEnumStmt
Definition: nodes.h:411
@ T_AppendState
Definition: nodes.h:109
@ T_GatherMergePath
Definition: nodes.h:262
@ T_Query
Definition: nodes.h:330
@ T_A_ArrayExpr
Definition: nodes.h:461
@ T_SetOpPath
Definition: nodes.h:273
@ T_UnlistenStmt
Definition: nodes.h:363
@ T_FromExpr
Definition: nodes.h:202
@ T_Memoize
Definition: nodes.h:78
@ T_TidRangePath
Definition: nodes.h:248
@ T_TriggerTransition
Definition: nodes.h:502
@ T_TransactionStmt
Definition: nodes.h:364
@ T_LockRowsState
Definition: nodes.h:148
@ T_ParamPathInfo
Definition: nodes.h:241
@ T_AlterExtensionContentsStmt
Definition: nodes.h:430
@ T_AlterFdwStmt
Definition: nodes.h:417
@ T_Sort
Definition: nodes.h:79
@ T_NamedTuplestoreScanState
Definition: nodes.h:128
@ T_BitmapAndPath
Definition: nodes.h:245
@ T_RowExpr
Definition: nodes.h:185
@ T_TargetEntry
Definition: nodes.h:199
@ T_AlterStatsStmt
Definition: nodes.h:448
@ T_AlterEventTrigStmt
Definition: nodes.h:432
@ T_ProjectionPath
Definition: nodes.h:263
@ T_PlannerInfo
Definition: nodes.h:236
@ T_AlterOpFamilyStmt
Definition: nodes.h:396
@ T_DropStmt
Definition: nodes.h:351
@ T_FuncCall
Definition: nodes.h:457
@ T_CreateTransformStmt
Definition: nodes.h:438
@ T_SubPlanState
Definition: nodes.h:230
@ T_Float
Definition: nodes.h:309
@ T_AlterTableCmd
Definition: nodes.h:340
@ T_SeqScan
Definition: nodes.h:56
@ T_ArrayCoerceExpr
Definition: nodes.h:178
@ T_A_Const
Definition: nodes.h:456
@ T_TidScanState
Definition: nodes.h:121
@ T_IndexInfo
Definition: nodes.h:33
@ T_ModifyTableState
Definition: nodes.h:108
@ T_AggState
Definition: nodes.h:141
@ T_String
Definition: nodes.h:311
@ T_ProjectSetState
Definition: nodes.h:107
@ T_AlterSeqStmt
Definition: nodes.h:374
@ T_GatherState
Definition: nodes.h:144
@ T_JunkFilter
Definition: nodes.h:36
@ T_BitmapOrState
Definition: nodes.h:113
@ T_WindowAgg
Definition: nodes.h:83
@ T_FunctionScanState
Definition: nodes.h:124
@ T_CTECycleClause
Definition: nodes.h:498
@ T_MinMaxExpr
Definition: nodes.h:188
@ T_MaterialPath
Definition: nodes.h:258
@ T_A_Expr
Definition: nodes.h:453
@ T_AlterFunctionStmt
Definition: nodes.h:357
@ T_SetOpState
Definition: nodes.h:147
@ T_InferClause
Definition: nodes.h:495
@ T_TriggerData
Definition: nodes.h:547
@ T_A_Indirection
Definition: nodes.h:460
@ T_RecursiveUnionPath
Definition: nodes.h:274
@ T_ForeignPath
Definition: nodes.h:250
@ T_ForeignKeyCacheInfo
Definition: nodes.h:557
@ T_CurrentOfExpr
Definition: nodes.h:196
@ T_IndexStmt
Definition: nodes.h:355
@ T_ProjectSet
Definition: nodes.h:48
@ T_AlterDatabaseRefreshCollStmt
Definition: nodes.h:389
@ T_AlterObjectSchemaStmt
Definition: nodes.h:404
@ T_CreatePolicyStmt
Definition: nodes.h:436
@ T_ReturnSetInfo
Definition: nodes.h:549
@ T_AlterPolicyStmt
Definition: nodes.h:437
@ T_MergeJoin
Definition: nodes.h:75
@ T_UniqueState
Definition: nodes.h:143
@ T_SampleScan
Definition: nodes.h:57
@ T_SortBy
Definition: nodes.h:466
@ T_MergeAppendPath
Definition: nodes.h:256
@ T_ValuesScan
Definition: nodes.h:66
@ T_AllocSetContext
Definition: nodes.h:301
@ T_Aggref
Definition: nodes.h:160
@ T_GroupingSetsPath
Definition: nodes.h:270
@ T_DropTableSpaceStmt
Definition: nodes.h:402
@ T_BooleanTest
Definition: nodes.h:192
@ T_BitmapAnd
Definition: nodes.h:53
@ T_ReadReplicationSlotCmd
Definition: nodes.h:535
@ T_ParamRef
Definition: nodes.h:455
@ T_MemoizeState
Definition: nodes.h:137
@ T_MergeAppend
Definition: nodes.h:51
@ T_CompositeTypeStmt
Definition: nodes.h:410
@ T_OidList
Definition: nodes.h:319
@ T_MergeJoinState
Definition: nodes.h:134
@ T_DropReplicationSlotCmd
Definition: nodes.h:534
@ T_Integer
Definition: nodes.h:308
@ T_BitmapHeapPath
Definition: nodes.h:244
@ T_CallStmt
Definition: nodes.h:447
@ T_CreateDomainStmt
Definition: nodes.h:367
@ T_AlterTSConfigurationStmt
Definition: nodes.h:415
@ T_PlanState
Definition: nodes.h:105
@ T_Agg
Definition: nodes.h:82
@ T_GrantRoleStmt
Definition: nodes.h:344
@ T_A_Star
Definition: nodes.h:458
@ T_RangeTblFunction
Definition: nodes.h:480
@ T_CreateForeignServerStmt
Definition: nodes.h:418
@ T_UpperUniquePath
Definition: nodes.h:268
@ T_RowMarkClause
Definition: nodes.h:492
@ T_InsertStmt
Definition: nodes.h:332
@ T_WithClause
Definition: nodes.h:494
@ T_CreateTableAsStmt
Definition: nodes.h:372
@ T_IntList
Definition: nodes.h:318
@ T_VacuumRelation
Definition: nodes.h:508
@ T_BitmapAndState
Definition: nodes.h:112
@ T_DeclareCursorStmt
Definition: nodes.h:400
@ T_AppendRelInfo
Definition: nodes.h:288
@ T_DefineStmt
Definition: nodes.h:350
@ T_CreateOpFamilyStmt
Definition: nodes.h:395
@ T_FetchStmt
Definition: nodes.h:354
@ T_CreatePLangStmt
Definition: nodes.h:379
@ T_CteScan
Definition: nodes.h:68
@ T_DeallocateStmt
Definition: nodes.h:399
@ T_RollupData
Definition: nodes.h:293
@ T_CopyStmt
Definition: nodes.h:348
@ T_WindowFuncExprState
Definition: nodes.h:228
@ T_WindowAggState
Definition: nodes.h:142
@ T_SubPlan
Definition: nodes.h:172
@ T_NestLoop
Definition: nodes.h:74
@ T_SQLValueFunction
Definition: nodes.h:189
@ T_LockRowsPath
Definition: nodes.h:275
@ T_UniquePath
Definition: nodes.h:260
@ T_NamedArgExpr
Definition: nodes.h:165
@ T_DropSubscriptionStmt
Definition: nodes.h:444
@ T_ReplicaIdentityStmt
Definition: nodes.h:434
@ T_PLAssignStmt
Definition: nodes.h:338
@ T_IncrementalSort
Definition: nodes.h:80
@ T_CustomScan
Definition: nodes.h:72
@ T_Const
Definition: nodes.h:158
@ T_Group
Definition: nodes.h:81
@ T_NestLoopParam
Definition: nodes.h:92
@ T_ModifyTable
Definition: nodes.h:49
@ T_AlterExtensionStmt
Definition: nodes.h:429
@ T_CreateUserMappingStmt
Definition: nodes.h:420
@ T_AlterTSDictionaryStmt
Definition: nodes.h:414
@ T_WindowAggPath
Definition: nodes.h:272
@ T_LimitPath
Definition: nodes.h:277
@ T_GatherMerge
Definition: nodes.h:86
@ T_TimeLineHistoryCmd
Definition: nodes.h:537
@ T_CoerceViaIO
Definition: nodes.h:177
@ T_AlterUserMappingStmt
Definition: nodes.h:421
@ T_AlterOwnerStmt
Definition: nodes.h:405
@ T_PartitionRangeDatum
Definition: nodes.h:506
@ T_SlabContext
Definition: nodes.h:302
@ T_ScanState
Definition: nodes.h:114
@ T_AlterSystemStmt
Definition: nodes.h:435
@ T_NextValueExpr
Definition: nodes.h:197
@ T_TsmRoutine
Definition: nodes.h:556
@ T_PartitionBoundSpec
Definition: nodes.h:505
@ T_CreateAmStmt
Definition: nodes.h:439
@ T_NestLoopState
Definition: nodes.h:133
@ T_Param
Definition: nodes.h:159
@ T_TableFuncScanState
Definition: nodes.h:125
@ T_AlterDomainStmt
Definition: nodes.h:341
@ T_CoerceToDomain
Definition: nodes.h:193
@ T_WindowDef
Definition: nodes.h:467
@ T_GroupingFunc
Definition: nodes.h:161
@ T_ConstraintsSetStmt
Definition: nodes.h:384
@ T_BitmapIndexScanState
Definition: nodes.h:119
@ T_SelectStmt
Definition: nodes.h:336
@ T_SubqueryScan
Definition: nodes.h:64
@ T_AlterDatabaseSetStmt
Definition: nodes.h:390
@ T_IndexScanState
Definition: nodes.h:117
@ T_DistinctExpr
Definition: nodes.h:167
@ T_PartitionSpec
Definition: nodes.h:504
@ T_CollateClause
Definition: nodes.h:465
@ T_MergePath
Definition: nodes.h:253
@ T_SetOp
Definition: nodes.h:88
@ T_CreateExtensionStmt
Definition: nodes.h:428
@ T_CreateCastStmt
Definition: nodes.h:393
@ T_RangeTableSample
Definition: nodes.h:470
@ T_RefreshMatViewStmt
Definition: nodes.h:433
@ T_ColumnRef
Definition: nodes.h:454
@ T_GrantStmt
Definition: nodes.h:343
@ T_AlterSubscriptionStmt
Definition: nodes.h:443
@ T_CreatedbStmt
Definition: nodes.h:368
@ T_GroupingSetData
Definition: nodes.h:294
@ T_ProjectSetPath
Definition: nodes.h:264
@ T_FuncExpr
Definition: nodes.h:164
@ T_Var
Definition: nodes.h:157
@ T_Join
Definition: nodes.h:73
@ T_PlannedStmt
Definition: nodes.h:331
@ T_GenerationContext
Definition: nodes.h:303
@ T_GatherMergeState
Definition: nodes.h:145
@ T_RowCompareExpr
Definition: nodes.h:186
@ T_RangeSubselect
Definition: nodes.h:468
@ T_CaseTestExpr
Definition: nodes.h:183
@ T_NullTest
Definition: nodes.h:191
@ T_ForeignScanState
Definition: nodes.h:130
@ T_PlannerGlobal
Definition: nodes.h:237
@ T_StartReplicationCmd
Definition: nodes.h:536
@ T_Invalid
Definition: nodes.h:28
@ T_AlterDefaultPrivilegesStmt
Definition: nodes.h:345
@ T_VariableSetStmt
Definition: nodes.h:375
@ T_SecLabelStmt
Definition: nodes.h:425
@ T_Result
Definition: nodes.h:47
@ T_AppendPath
Definition: nodes.h:255
@ T_IndexClause
Definition: nodes.h:285
@ T_AlterTableStmt
Definition: nodes.h:339
@ T_CaseWhen
Definition: nodes.h:182
@ T_EquivalenceMember
Definition: nodes.h:280
@ T_JoinState
Definition: nodes.h:132
@ T_CreateOpClassStmt
Definition: nodes.h:394
@ T_LimitState
Definition: nodes.h:149
@ T_IndexAmRoutine
Definition: nodes.h:554
@ T_EState
Definition: nodes.h:40
@ T_PartitionPruneStepCombine
Definition: nodes.h:97
@ T_SubscriptingRef
Definition: nodes.h:163
@ T_OnConflictClause
Definition: nodes.h:496
@ T_PartitionPruneStepOp
Definition: nodes.h:96
@ T_IndexScan
Definition: nodes.h:58
@ T_IndexElem
Definition: nodes.h:475
@ T_EquivalenceClass
Definition: nodes.h:279
@ T_IntoClause
Definition: nodes.h:204
@ T_ViewStmt
Definition: nodes.h:365
@ T_AlterTableMoveAllStmt
Definition: nodes.h:424
@ T_SupportRequestIndexCondition
Definition: nodes.h:563
@ T_BitmapOrPath
Definition: nodes.h:246
@ T_ClosePortalStmt
Definition: nodes.h:346
@ T_RangeTableFuncCol
Definition: nodes.h:472
@ T_SetToDefault
Definition: nodes.h:195
@ T_CreateReplicationSlotCmd
Definition: nodes.h:533
@ T_BitmapHeapScan
Definition: nodes.h:61
@ T_AlterRoleSetStmt
Definition: nodes.h:391
@ T_CommentStmt
Definition: nodes.h:353
@ T_TypeCast
Definition: nodes.h:464
@ T_TableAmRoutine
Definition: nodes.h:555
@ T_WorkTableScan
Definition: nodes.h:70
@ T_ForeignScan
Definition: nodes.h:71
@ T_Boolean
Definition: nodes.h:310
@ T_HashJoin
Definition: nodes.h:76
@ T_NullIfExpr
Definition: nodes.h:168
@ T_TableLikeClause
Definition: nodes.h:489
@ T_Path
Definition: nodes.h:242
@ T_RoleSpec
Definition: nodes.h:501
@ T_GatherPath
Definition: nodes.h:261
@ T_IndexPath
Definition: nodes.h:243
@ T_PlaceHolderVar
Definition: nodes.h:286
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
object_access_hook_type_str object_access_hook_str
Definition: objectaccess.c:23
void(* object_access_hook_type)(ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
Definition: objectaccess.h:125
void(* object_access_hook_type_str)(ObjectAccessType access, Oid classId, const char *objectStr, int subId, void *arg)
Definition: objectaccess.h:131
ObjectAccessType
Definition: objectaccess.h:47
@ OAT_NAMESPACE_SEARCH
Definition: objectaccess.h:51
@ OAT_FUNCTION_EXECUTE
Definition: objectaccess.h:52
@ OAT_DROP
Definition: objectaccess.h:49
@ OAT_TRUNCATE
Definition: objectaccess.h:53
@ OAT_POST_ALTER
Definition: objectaccess.h:50
@ OAT_POST_CREATE
Definition: objectaccess.h:48
#define ACL_SET
Definition: parsenodes.h:94
#define ACL_ALTER_SYSTEM
Definition: parsenodes.h:95
void * arg
unsigned int Oid
Definition: postgres_ext.h:31
char * psprintf(const char *fmt,...)
Definition: psprintf.c:46
Definition: pg_list.h:51
Definition: nodes.h:574
Node * utilityStmt
Definition: plannodes.h:87
bool superuser_arg(Oid roleid)
Definition: superuser.c:56
static bool REGRESS_suset_variable1
static bool REGRESS_deny_exec_perms
static const char * nodetag_to_string(NodeTag tag)
static bool REGRESS_deny_object_access
static void REGRESS_utility_command(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
void _PG_init(void)
static ExecutorCheckPerms_hook_type next_exec_check_perms_hook
static ProcessUtility_hook_type next_ProcessUtility_hook
static void emit_audit_message(const char *type, const char *hook, char *action, char *objName)
static bool REGRESS_exec_check_perms(List *rangeTabls, bool do_abort)
static bool REGRESS_deny_set_variable
static bool REGRESS_userset_variable2
PG_MODULE_MAGIC
static char * accesstype_arg_to_string(ObjectAccessType access, void *arg)
static bool REGRESS_deny_alter_system
static void REGRESS_object_access_hook(ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
static void audit_attempt(const char *hook, char *action, char *objName)
static char * accesstype_to_string(ObjectAccessType access, int subId)
static bool REGRESS_userset_variable1
static void audit_failure(const char *hook, char *action, char *objName)
static bool REGRESS_deny_utility_commands
static object_access_hook_type next_object_access_hook
static object_access_hook_type_str next_object_access_hook_str
static bool REGRESS_suset_variable2
static void REGRESS_object_access_hook_str(ObjectAccessType access, Oid classId, const char *objName, int subId, void *arg)
static void audit_success(const char *hook, char *action, char *objName)
static bool REGRESS_audit
void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
Definition: utility.c:547
ProcessUtility_hook_type ProcessUtility_hook
Definition: utility.c:77
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)
Definition: utility.h:71
ProcessUtilityContext
Definition: utility.h:21