]> granicus.if.org Git - postgresql/commit
Doc: fix oversimplified example for CREATE POLICY.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 30 Jul 2018 15:54:41 +0000 (11:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 30 Jul 2018 15:54:41 +0000 (11:54 -0400)
commit506bbbf02e8c045b6d35dc3b0083e5a12f7b3837
tree7dc971a5ff40785fe3dd2c23d6f8c82f7eee18b4
parent5ed0b6daec542ea1787ed4265fb75448e8f27e66
Doc: fix oversimplified example for CREATE POLICY.

As written, this policy constrained only the post-image not the pre-image
of rows, meaning that users could delete other users' rows or take
ownership of such rows, contrary to what the docs claimed would happen.
We need two separate policies to achieve the documented effect.

While at it, try to explain what's happening a bit more fully.

Per report from Олег Самойлов.  Back-patch to 9.5 where this was added.
Thanks to Stephen Frost for off-list discussion.

Discussion: https://postgr.es/m/3298321532002010@sas1-2b3c3045b736.qloud-c.yandex.net
doc/src/sgml/ddl.sgml