pgsql: Enforce WITH CHECK OPTION on DELETE FOR PORTION OF leftovers
Enforce WITH CHECK OPTION on DELETE FOR PORTION OF leftovers
DELETE FOR PORTION OF inserts temporal leftovers through ExecInsert(),
but the rewriter only attached view WCOs for INSERT/UPDATE. Leftover
rows could therefore silently escape a WITH CHECK OPTION view, while
the equivalent UPDATE correctly raised an error.
This commit fixes it by attaching the WCOs for FOR PORTION OF deletes
too.
Author: Zsolt Parragi <zsolt.parragi@percona.com>
Co-authored-by: Paul A Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: solai v <solai.cdac@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Discussion: /messages/by-id/CAN4CZFOuTyhGspG0Nyits8PiK2keoNXkLj-u3APzc66aRcWY9A@mail.gmail.com
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f3a116a26ff0c0be83b990d3d9b3fd9e425bb197
Modified Files
--------------
doc/src/sgml/ref/create_view.sgml | 20 ++++++----
src/backend/rewrite/rewriteHandler.c | 8 +++-
src/test/regress/expected/updatable_views.out | 56 +++++++++++++++++++++++++++
src/test/regress/sql/updatable_views.sql | 29 ++++++++++++++
4 files changed, 104 insertions(+), 9 deletions(-)