1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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.
This commit is contained in:
Joe Conway
2015-07-28 16:01:53 -07:00
parent 8c72a7fab4
commit f781a0f1d8
6 changed files with 177 additions and 26 deletions

View File

@ -5792,6 +5792,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term><symbol>SHARED_DEPENDENCY_POLICY</> (<literal>r</>)</term>
<listitem>
<para>
The referenced object (which must be a role) is mentioned as the
target of a dependent policy object.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><symbol>SHARED_DEPENDENCY_PIN</> (<literal>p</>)</term>
<listitem>