Centralize DML permissions-checking logic.
Robert Haas <rhaas@postgresql.org>
Centralize DML permissions-checking logic. Remove bespoke code in DoCopy and RI_Initial_Check, which now instead fabricate call ExecCheckRTPerms with a manufactured RangeTblEntry. This is intended to make it feasible for an enhanced security provider to actually make use of ExecutorCheckPerms_hook, but also has the advantage that RI_Initial_Check can allow use of the fast-path when column-level but not table-level permissions are present. KaiGai Kohei. Reviewed (in an earlier version) by Stephen Frost, and by me. Some further changes to the comments by me.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +19 −22 |
| src/backend/executor/execMain.c | modified | +37 −27 |
| src/backend/utils/adt/ri_triggers.c | modified | +30 −6 |
| src/include/executor/executor.h | modified | +3 −2 |