54 Oid classId,
const char *objName,
55 int subId,
void *
arg);
57 Oid objectId,
int subId,
void *
arg);
60 const char *queryString,
bool readOnlyTree,
84 "Deny non-superuser set permissions",
98 "Deny non-superuser alter system set permissions",
112 "Deny non-superuser object access permissions",
126 "Deny non-superuser exec permissions",
140 "Deny non-superuser utility commands",
154 "Turn on/off debug audit messages",
168 "Dummy parameter settable by public",
179 "Dummy parameter settable by public",
193 "Dummy parameter settable by superuser",
204 "Dummy parameter settable by superuser",
247 (
errcode(ERRCODE_INTERNAL_ERROR),
251 (
errcode(ERRCODE_INTERNAL_ERROR),
288 (*next_object_access_hook_str) (access, classId, objName, subId,
arg);
298 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
299 errmsg(
"permission denied: all privileges %s", objName)));
305 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
306 errmsg(
"permission denied: set %s", objName)));
312 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
313 errmsg(
"permission denied: alter system set %s", objName)));
316 elog(
ERROR,
"Unknown ParameterAclRelationId subId: %d", subId);
336 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
337 errmsg(
"permission denied: %s [%s]",
343 (*next_object_access_hook) (access, classId, objectId, subId,
arg);
360 if (do_abort && !allow)
362 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
363 errmsg(
"permission denied: %s",
"execute")));
384 const char *queryString,
420 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
425 (*next_ProcessUtility_hook) (pstmt, queryString, readOnlyTree,
426 context, params, queryEnv,
430 context, params, queryEnv,
451 return "ExprContext";
454 return "ProjectionInfo";
460 return "OnConflictSetState";
463 return "ResultRelInfo";
469 return "TupleTableSlot";
481 return "ModifyTable";
487 return "MergeAppend";
490 return "RecursiveUnion";
511 return "IndexOnlyScan";
514 return "BitmapIndexScan";
517 return "BitmapHeapScan";
523 return "TidRangeScan";
526 return "SubqueryScan";
529 return "FunctionScan";
535 return "TableFuncScan";
541 return "NamedTuplestoreScan";
544 return "WorkTableScan";
547 return "ForeignScan";
574 return "IncrementalSort";
592 return "GatherMerge";
607 return "NestLoopParam";
610 return "PlanRowMark";
613 return "PartitionPruneInfo";
616 return "PartitionedRelPruneInfo";
619 return "PartitionPruneStepOp";
622 return "PartitionPruneStepCombine";
625 return "PlanInvalItem";
631 return "ResultState";
634 return "ProjectSetState";
637 return "ModifyTableState";
640 return "AppendState";
643 return "MergeAppendState";
646 return "RecursiveUnionState";
649 return "BitmapAndState";
652 return "BitmapOrState";
658 return "SeqScanState";
661 return "SampleScanState";
664 return "IndexScanState";
667 return "IndexOnlyScanState";
670 return "BitmapIndexScanState";
673 return "BitmapHeapScanState";
676 return "TidScanState";
679 return "TidRangeScanState";
682 return "SubqueryScanState";
685 return "FunctionScanState";
688 return "TableFuncScanState";
691 return "ValuesScanState";
694 return "CteScanState";
697 return "NamedTuplestoreScanState";
700 return "WorkTableScanState";
703 return "ForeignScanState";
706 return "CustomScanState";
712 return "NestLoopState";
715 return "MergeJoinState";
718 return "HashJoinState";
721 return "MaterialState";
724 return "MemoizeState";
730 return "IncrementalSortState";
739 return "WindowAggState";
742 return "UniqueState";
745 return "GatherState";
748 return "GatherMergeState";
757 return "LockRowsState";
784 return "GroupingFunc";
790 return "SubscriptingRef";
796 return "NamedArgExpr";
802 return "DistinctExpr";
808 return "ScalarArrayOpExpr";
820 return "AlternativeSubPlan";
823 return "FieldSelect";
829 return "RelabelType";
832 return "CoerceViaIO";
835 return "ArrayCoerceExpr";
838 return "ConvertRowtypeExpr";
841 return "CollateExpr";
850 return "CaseTestExpr";
859 return "RowCompareExpr";
862 return "CoalesceExpr";
868 return "SQLValueFunction";
877 return "BooleanTest";
880 return "CoerceToDomain";
883 return "CoerceToDomainValue";
886 return "SetToDefault";
889 return "CurrentOfExpr";
892 return "NextValueExpr";
895 return "InferenceElem";
898 return "TargetEntry";
901 return "RangeTblRef";
910 return "OnConflictExpr";
919 return "WindowFuncExprState";
922 return "SetExprState";
925 return "SubPlanState";
928 return "DomainConstraintState";
931 return "PlannerInfo";
934 return "PlannerGlobal";
940 return "IndexOptInfo";
943 return "ForeignKeyOptInfo";
946 return "ParamPathInfo";
955 return "BitmapHeapPath";
958 return "BitmapAndPath";
961 return "BitmapOrPath";
967 return "TidRangePath";
970 return "SubqueryScanPath";
973 return "ForeignPath";
991 return "MergeAppendPath";
994 return "GroupResultPath";
997 return "MaterialPath";
1000 return "MemoizePath";
1003 return "UniquePath";
1006 return "GatherPath";
1009 return "GatherMergePath";
1012 return "ProjectionPath";
1015 return "ProjectSetPath";
1021 return "IncrementalSortPath";
1027 return "UpperUniquePath";
1033 return "GroupingSetsPath";
1036 return "MinMaxAggPath";
1039 return "WindowAggPath";
1045 return "RecursiveUnionPath";
1048 return "LockRowsPath";
1051 return "ModifyTablePath";
1057 return "EquivalenceClass";
1060 return "EquivalenceMember";
1066 return "PathTarget";
1069 return "RestrictInfo";
1072 return "IndexClause";
1075 return "PlaceHolderVar";
1078 return "SpecialJoinInfo";
1081 return "AppendRelInfo";
1084 return "RowIdentityVarInfo";
1087 return "PlaceHolderInfo";
1090 return "MinMaxAggInfo";
1093 return "PlannerParamItem";
1096 return "RollupData";
1099 return "GroupingSetData";
1102 return "StatisticExtInfo";
1105 return "AllocSetContext";
1108 return "SlabContext";
1111 return "GenerationContext";
1138 return "ExtensibleNode";
1147 return "PlannedStmt";
1150 return "InsertStmt";
1153 return "DeleteStmt";
1156 return "UpdateStmt";
1159 return "SelectStmt";
1162 return "ReturnStmt";
1165 return "PLAssignStmt";
1168 return "AlterTableStmt";
1171 return "AlterTableCmd";
1174 return "AlterDomainStmt";
1177 return "SetOperationStmt";
1183 return "GrantRoleStmt";
1186 return "AlterDefaultPrivilegesStmt";
1189 return "ClosePortalStmt";
1192 return "ClusterStmt";
1198 return "CreateStmt";
1201 return "DefineStmt";
1207 return "TruncateStmt";
1210 return "CommentStmt";
1219 return "CreateFunctionStmt";
1222 return "AlterFunctionStmt";
1228 return "RenameStmt";
1234 return "NotifyStmt";
1237 return "ListenStmt";
1240 return "UnlistenStmt";
1243 return "TransactionStmt";
1252 return "CreateDomainStmt";
1255 return "CreatedbStmt";
1258 return "DropdbStmt";
1261 return "VacuumStmt";
1264 return "ExplainStmt";
1267 return "CreateTableAsStmt";
1270 return "CreateSeqStmt";
1273 return "AlterSeqStmt";
1276 return "VariableSetStmt";
1279 return "VariableShowStmt";
1282 return "DiscardStmt";
1285 return "CreateTrigStmt";
1288 return "CreatePLangStmt";
1291 return "CreateRoleStmt";
1294 return "AlterRoleStmt";
1297 return "DropRoleStmt";
1303 return "ConstraintsSetStmt";
1306 return "ReindexStmt";
1309 return "CheckPointStmt";
1312 return "CreateSchemaStmt";
1315 return "AlterDatabaseStmt";
1318 return "AlterDatabaseRefreshCollStmt";
1321 return "AlterDatabaseSetStmt";
1324 return "AlterRoleSetStmt";
1327 return "CreateConversionStmt";
1330 return "CreateCastStmt";
1333 return "CreateOpClassStmt";
1336 return "CreateOpFamilyStmt";
1339 return "AlterOpFamilyStmt";
1342 return "PrepareStmt";
1345 return "ExecuteStmt";
1348 return "DeallocateStmt";
1351 return "DeclareCursorStmt";
1354 return "CreateTableSpaceStmt";
1357 return "DropTableSpaceStmt";
1360 return "AlterObjectDependsStmt";
1363 return "AlterObjectSchemaStmt";
1366 return "AlterOwnerStmt";
1369 return "AlterOperatorStmt";
1372 return "AlterTypeStmt";
1375 return "DropOwnedStmt";
1378 return "ReassignOwnedStmt";
1381 return "CompositeTypeStmt";
1384 return "CreateEnumStmt";
1387 return "CreateRangeStmt";
1390 return "AlterEnumStmt";
1393 return "AlterTSDictionaryStmt";
1396 return "AlterTSConfigurationStmt";
1399 return "CreateFdwStmt";
1402 return "AlterFdwStmt";
1405 return "CreateForeignServerStmt";
1408 return "AlterForeignServerStmt";
1411 return "CreateUserMappingStmt";
1414 return "AlterUserMappingStmt";
1417 return "DropUserMappingStmt";
1420 return "AlterTableSpaceOptionsStmt";
1423 return "AlterTableMoveAllStmt";
1426 return "SecLabelStmt";
1429 return "CreateForeignTableStmt";
1432 return "ImportForeignSchemaStmt";
1435 return "CreateExtensionStmt";
1438 return "AlterExtensionStmt";
1441 return "AlterExtensionContentsStmt";
1444 return "CreateEventTrigStmt";
1447 return "AlterEventTrigStmt";
1450 return "RefreshMatViewStmt";
1453 return "ReplicaIdentityStmt";
1456 return "AlterSystemStmt";
1459 return "CreatePolicyStmt";
1462 return "AlterPolicyStmt";
1465 return "CreateTransformStmt";
1468 return "CreateAmStmt";
1471 return "CreatePublicationStmt";
1474 return "AlterPublicationStmt";
1477 return "CreateSubscriptionStmt";
1480 return "AlterSubscriptionStmt";
1483 return "DropSubscriptionStmt";
1486 return "CreateStatsStmt";
1489 return "AlterCollationStmt";
1495 return "AlterStatsStmt";
1519 return "A_Indirection";
1522 return "A_ArrayExpr";
1528 return "MultiAssignRef";
1534 return "CollateClause";
1543 return "RangeSubselect";
1546 return "RangeFunction";
1549 return "RangeTableSample";
1552 return "RangeTableFunc";
1555 return "RangeTableFuncCol";
1570 return "Constraint";
1576 return "RangeTblEntry";
1579 return "RangeTblFunction";
1582 return "TableSampleClause";
1585 return "WithCheckOption";
1588 return "SortGroupClause";
1591 return "GroupingSet";
1594 return "WindowClause";
1597 return "ObjectWithArgs";
1600 return "AccessPriv";
1603 return "CreateOpClassItem";
1606 return "TableLikeClause";
1609 return "FunctionParameter";
1612 return "LockingClause";
1615 return "RowMarkClause";
1618 return "XmlSerialize";
1621 return "WithClause";
1624 return "InferClause";
1627 return "OnConflictClause";
1630 return "CTESearchClause";
1633 return "CTECycleClause";
1636 return "CommonTableExpr";
1642 return "TriggerTransition";
1645 return "PartitionElem";
1648 return "PartitionSpec";
1651 return "PartitionBoundSpec";
1654 return "PartitionRangeDatum";
1657 return "PartitionCmd";
1660 return "VacuumRelation";
1663 return "PublicationObjSpec";
1666 return "PublicationTable";
1669 return "IdentifySystemCmd";
1672 return "BaseBackupCmd";
1675 return "CreateReplicationSlotCmd";
1678 return "DropReplicationSlotCmd";
1681 return "ReadReplicationSlotCmd";
1684 return "StartReplicationCmd";
1687 return "TimeLineHistoryCmd";
1690 return "TriggerData";
1693 return "EventTriggerData";
1696 return "ReturnSetInfo";
1699 return "WindowObjectData";
1705 return "InlineCodeBlock";
1708 return "FdwRoutine";
1711 return "IndexAmRoutine";
1714 return "TableAmRoutine";
1717 return "TsmRoutine";
1720 return "ForeignKeyCacheInfo";
1723 return "CallContext";
1726 return "SupportRequestSimplify";
1729 return "SupportRequestSelectivity";
1732 return "SupportRequestCost";
1735 return "SupportRequestRows";
1738 return "SupportRequestIndexCondition";
1743 return "UNRECOGNIZED NodeTag";
1763 type =
"namespace search";
1772 type =
"UNRECOGNIZED ObjectAccessType";
1776 return psprintf(
"%s (subId=0x%x, all privileges)",
type, subId);
1780 return psprintf(
"%s (subId=0x%x, alter system)",
type, subId);
1789 return pstrdup(
"extra info null");
1806 ?
"internal action," :
""),
1808 ?
"concurrent drop," :
""),
1810 ?
"suppress notices," :
""),
1812 ?
"keep original object," :
""),
1814 ?
"keep extensions," :
""),
1816 ?
"normal concurrent drop," :
""));
1823 return psprintf(
"%s %s auxiliary object",
1834 (ns_arg->
result ?
"allowed" :
"denied"));
1840 return pstrdup(
"unexpected extra info pointer received");
1842 return pstrdup(
"cannot parse extra info for unrecognized access type");
#define OidIsValid(objectId)
#define PERFORM_DELETION_INTERNAL
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook
bool(* ExecutorCheckPerms_hook_type)(List *, bool)
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)
void MarkGUCPrefixReserved(const char *className)
#define GUC_NOT_IN_SAMPLE
#define IsParallelWorker()
char * pstrdup(const char *in)
void pfree(void *pointer)
@ T_DomainConstraintState
@ T_SupportRequestSelectivity
@ T_ImportForeignSchemaStmt
@ T_AlterTableSpaceOptionsStmt
@ T_CreateSubscriptionStmt
@ T_CreatePublicationStmt
@ T_CreateForeignTableStmt
@ T_AlterObjectDependsStmt
@ T_SupportRequestSimplify
@ T_PartitionedRelPruneInfo
@ T_AlterForeignServerStmt
@ T_AlterExtensionContentsStmt
@ T_NamedTuplestoreScanState
@ T_AlterDatabaseRefreshCollStmt
@ T_AlterObjectSchemaStmt
@ T_ReadReplicationSlotCmd
@ T_DropReplicationSlotCmd
@ T_AlterTSConfigurationStmt
@ T_CreateForeignServerStmt
@ T_CreateUserMappingStmt
@ T_AlterTSDictionaryStmt
@ T_AlterSubscriptionStmt
@ T_AlterDefaultPrivilegesStmt
@ T_PartitionPruneStepCombine
@ T_AlterTableMoveAllStmt
@ T_SupportRequestIndexCondition
@ T_CreateReplicationSlotCmd
object_access_hook_type object_access_hook
object_access_hook_type_str object_access_hook_str
void(* object_access_hook_type)(ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
void(* object_access_hook_type_str)(ObjectAccessType access, Oid classId, const char *objectStr, int subId, void *arg)
char * psprintf(const char *fmt,...)
bool ereport_on_violation
bool superuser_arg(Oid roleid)
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)
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
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)
ProcessUtility_hook_type ProcessUtility_hook
void(* ProcessUtility_hook_type)(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc)