Fix assertion failures in DELETE FOR PORTION OF tuple routing

We must handle cases where an inserted temporal leftover gets routed to
a different partition than the original tuple's. This happens if the
partition key depends on the application-time column used in the FOR
PORTION OF clause. Everything works for UPDATE, but for DELETE we can
hit some Asserts, since that operation never needed to be covered
before. One Assert is for the RETURNING list; the other, for WITH CHECK
OPTION. This commit updates both to include CMD_DELETE.

Author: Paul A Jungwirth <[email protected]>
Reported-by: Peter Eisentraut <[email protected]>
Discussion: 
https://postgr.es/m/[email protected]

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/938f4f8f343415f5ce17d0e3f0736b2c118d422e

Modified Files
--------------
src/backend/executor/execPartition.c          | 22 +++++++---
src/test/regress/expected/for_portion_of.out  | 59 +++++++++++++++++++++++++++
src/test/regress/expected/updatable_views.out | 45 ++++++++++++++++++++
src/test/regress/sql/for_portion_of.sql       | 42 +++++++++++++++++++
src/test/regress/sql/updatable_views.sql      | 33 +++++++++++++++
5 files changed, 195 insertions(+), 6 deletions(-)

Reply via email to