From: Fujii Masao Date: Thu, 6 Feb 2020 15:33:11 +0000 (+0900) Subject: Add note about access permission checks by inherited TRUNCATE and LOCK TABLE. X-Git-Tag: REL9_4_26~5 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=bf1840255123d90e777c72341d36149d09bef0e5;p=postgresql.git 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 e6f1e560e4 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 --- diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 8d2908c34d8..ba1b0571edc 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -2323,7 +2323,11 @@ VALUES ('New York', NULL, NULL, 'NY'); access privilege checking. This preserves the appearance that the data is (also) in the parent table. Accessing the child tables directly is, however, not automatically allowed and would require - further privileges to be granted. + further privileges to be granted. Two exceptions to this rule are + TRUNCATE and LOCK TABLE, + where permissions on the child tables are always checked, + whether they are processed directly or recursively via those commands + performed on the parent table.