]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix Assert failure for MERGE into a partitioned table with RLS.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Wed, 22 Feb 2023 10:54:57 +0000 (10:54 +0000)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Wed, 22 Feb 2023 10:54:57 +0000 (10:54 +0000)
commitd8c3b65db58db0a074dc9f7e27846e22e9dc579f
tree051914f5cb7dbbd6037333b72c24bcc6f31ba4af
parent018af1cc1c8075346e6a5fe3bb77b7e31399be70
Fix Assert failure for MERGE into a partitioned table with RLS.

In ExecInitPartitionInfo(), the Assert when building the WITH CHECK
OPTION list for the new partition assumed that the command would be an
INSERT or UPDATE, but it can also be a MERGE. This can be triggered by
a MERGE into a partitioned table with RLS checks to enforce.

Fix, and back-patch to v15, where MERGE was introduced.

Discussion: https://postgr.es/m/CAEZATCWWFtQmW67F3XTyMU5Am10Oxa_b8oe0x%2BNu5Mo%2BCdRErg%40mail.gmail.com
src/backend/executor/execPartition.c
src/test/regress/expected/merge.out
src/test/regress/sql/merge.sql