Assert failure with MERGE into partitioned table with RLS

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Assert failure with MERGE into partitioned table with RLS
Date: 2023-02-20 16:18:19
Message-ID: CAEZATCWWFtQmW67F3XTyMU5Am10Oxa_b8oe0x+Nu5Mo+CdRErg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As part of the MERGE RETURNING patch I noticed a suspicious Assert()
in ExecInitPartitionInfo() that looked like it needed updating for
MERGE.

After more testing, I can confirm that this is indeed a pre-existing
bug, that can be triggered using MERGE into a partitioned table that
has RLS enabled (and hence non-empty withCheckOptionLists to
initialise).

So I think we need something like the attached.

Regards,
Dean

Attachment Content-Type Size
fix-merge-assert-failure.patch text/x-patch 3.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-02-20 16:29:06 Re: Add WAL read stats to pg_stat_wal
Previous Message Markur Sens 2023-02-20 16:05:40 Re: pg_crc32c_armv8.c:35:9: error: implicit declaration of function '__crc32cb' is invalid in C99