Make inherited TRUNCATE perform access permission checks on parent table only.
authorFujii Masao <[email protected]>
Thu, 30 Jan 2020 15:46:20 +0000 (00:46 +0900)
committerFujii Masao <[email protected]>
Thu, 30 Jan 2020 15:47:09 +0000 (00:47 +0900)
commit56bc82a5111737d76f211356eeb2b1a8e657e8b4
treefd62c4fb04a91e91acd0aeeeb56affa97e276fff
parent8fc33e6cc10fcd801efff4d8ddbc22011fdd6108
Make inherited TRUNCATE perform access permission checks on parent table only.

Previously, TRUNCATE command through a parent table checked the
permissions on not only the parent table but also the children tables
inherited from it. This was a bug and inherited queries should perform
access permission checks on the parent table only. This commit fixes
that bug.

Back-patch to all supported branches.

Author: Amit Langote
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CAHGQGwFHdSvifhJE+-GSNqUHSfbiKxaeQQ7HGcYz6SC2n_oDcg@mail.gmail.com
src/backend/commands/tablecmds.c
src/test/regress/expected/privileges.out
src/test/regress/sql/privileges.sql