Create a pg_shdepend entry for each role in TO clause of policies.
Joe Conway <mail@joeconway.com>
Create a pg_shdepend entry for each role in TO clause of policies. CreatePolicy() and AlterPolicy() omit to create a pg_shdepend entry for each role in the TO clause. Fix this by creating a new shared dependency type called SHARED_DEPENDENCY_POLICY and assigning it to each role. Reported by Noah Misch. Patch by me, reviewed by Alvaro Herrera. Back-patch to 9.5 where RLS was introduced.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +10 −0 |
| src/backend/catalog/pg_shdepend.c | modified | +2 −0 |
| src/backend/commands/policy.c | modified | +61 −26 |
| src/include/catalog/dependency.h | modified | +5 −0 |
| src/test/regress/expected/rowsecurity.out | modified | +55 −0 |
| src/test/regress/sql/rowsecurity.sql | modified | +44 −0 |