diff options
author | Stephen Frost <sfrost@snowman.net> | 2014-11-27 01:06:36 -0500 |
---|---|---|
committer | Stephen Frost <sfrost@snowman.net> | 2014-11-27 01:15:57 -0500 |
commit | 143b39c1855f8a22f474f20354ee5ee5d2f4d266 (patch) | |
tree | 3633add36a9bb7a6a035d94077f6245e71f93acd /src/bin/pg_dump/pg_dump_sort.c | |
parent | 1812ee5767a25a36e7002be8a3a032357d3fe4e2 (diff) | |
download | postgresql-143b39c1855f8a22f474f20354ee5ee5d2f4d266.tar.gz postgresql-143b39c1855f8a22f474f20354ee5ee5d2f4d266.zip |
Rename pg_rowsecurity -> pg_policy and other fixes
As pointed out by Robert, we should really have named pg_rowsecurity
pg_policy, as the objects stored in that catalog are policies. This
patch fixes that and updates the column names to start with 'pol' to
match the new catalog name.
The security consideration for COPY with row level security, also
pointed out by Robert, has also been addressed by remembering and
re-checking the OID of the relation initially referenced during COPY
processing, to make sure it hasn't changed under us by the time we
finish planning out the query which has been built.
Robert and Alvaro also commented on missing OCLASS and OBJECT entries
for POLICY (formerly ROWSECURITY or POLICY, depending) in various
places. This patch fixes that too, which also happens to add the
ability to COMMENT on policies.
In passing, attempt to improve the consistency of messages, comments,
and documentation as well. This removes various incarnations of
'row-security', 'row-level security', 'Row-security', etc, in favor
of 'policy', 'row level security' or 'row_security' as appropriate.
Happy Thanksgiving!
Diffstat (limited to 'src/bin/pg_dump/pg_dump_sort.c')
-rw-r--r-- | src/bin/pg_dump/pg_dump_sort.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index 030bccc7e65..0e62af27765 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -28,8 +28,8 @@ static const char *modulename = gettext_noop("sorter"); * by OID. (This is a relatively crude hack to provide semi-reasonable * behavior for old databases without full dependency info.) Note: collations, * extensions, text search, foreign-data, materialized view, event trigger, - * and default ACL objects can't really happen here, so the rather bogus - * priorities for them don't matter. + * policies, and default ACL objects can't really happen here, so the rather + * bogus priorities for them don't matter. * * NOTE: object-type priorities must match the section assignments made in * pg_dump.c; that is, PRE_DATA objects must sort before DO_PRE_DATA_BOUNDARY, @@ -73,7 +73,7 @@ static const int oldObjectTypePriority[] = 13, /* DO_POST_DATA_BOUNDARY */ 20, /* DO_EVENT_TRIGGER */ 15, /* DO_REFRESH_MATVIEW */ - 21 /* DO_ROW_SECURITY */ + 21 /* DO_POLICY */ }; /* @@ -122,7 +122,7 @@ static const int newObjectTypePriority[] = 25, /* DO_POST_DATA_BOUNDARY */ 32, /* DO_EVENT_TRIGGER */ 33, /* DO_REFRESH_MATVIEW */ - 34 /* DO_ROW_SECURITY */ + 34 /* DO_POLICY */ }; static DumpId preDataBoundId; @@ -1438,9 +1438,9 @@ describeDumpableObject(DumpableObject *obj, char *buf, int bufsize) "BLOB DATA (ID %d)", obj->dumpId); return; - case DO_ROW_SECURITY: + case DO_POLICY: snprintf(buf, bufsize, - "ROW-SECURITY POLICY (ID %d OID %u)", + "POLICY (ID %d OID %u)", obj->dumpId, obj->catId.oid); return; case DO_PRE_DATA_BOUNDARY: |