Skip to content

Commit 87f738d

Browse files
committed
Add note about access permission checks by inherited TRUNCATE and LOCK TABLE.
Inherited queries perform access permission checks on the parent table only. But there are two exceptions to this rule in v12 or before; TRUNCATE and LOCK TABLE commands through a parent table check the permissions on not only the parent table but also the children tables. Previously these exceptions were not documented. This commit adds the note about these exceptions, into the document. Back-patch to v9.4. But we don't apply this commit to the master because commit e6f1e56 already got rid of the exception about inherited TRUNCATE and upcoming commit will do for the exception about inherited LOCK TABLE. Author: Amit Langote Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/CA+HiwqHfTnMU6SUkyHxCmpHUKk7ERLHCR3vZVq19ZOQBjPBLmQ@mail.gmail.com
1 parent 699700b commit 87f738d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doc/src/sgml/ddl.sgml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,15 @@ VALUES ('Albany', NULL, NULL, 'NY');
28082808
accessed through <structname>cities</>. This preserves the appearance
28092809
that the data is (also) in the parent table. But
28102810
the <structname>capitals</structname> table could not be updated directly
2811-
without an additional grant. In a similar way, the parent table's row
2811+
without an additional grant. Two exceptions to this rule are
2812+
<command>TRUNCATE</command> and <command>LOCK TABLE</command>,
2813+
where permissions on the child tables are always checked,
2814+
whether they are processed directly or recursively via those commands
2815+
performed on the parent table.
2816+
</para>
2817+
2818+
<para>
2819+
In a similar way, the parent table's row
28122820
security policies (see <xref linkend="ddl-rowsecurity">) are applied to
28132821
rows coming from child tables during an inherited query. A child table's
28142822
policies, if any, are applied only when it is the table explicitly named

0 commit comments

Comments
 (0)