Re: DELETE FOR PORTION OF bypasses view WITH CHECK OPTION for leftover rows - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: DELETE FOR PORTION OF bypasses view WITH CHECK OPTION for leftover rows
Date
Msg-id CAEZATCU0mdH+PJ+nHtUU7UGKUZH9BNh+gBuGALAOaJW0MyubsA@mail.gmail.com
Whole thread
List pgsql-bugs
On Thu, 13 Aug 2026, 00:19 Paul A Jungwirth, <pj@illuminatedcomputing.com> wrote:
On Wed, Aug 12, 2026 at 2:30 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
>
> On Wed, Jul 22, 2026 at 2:43 PM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> >
> > While testing FOR PORTION OF I noticed that DELETE FOR PORTION OF on a
> > view ignores the view's WITH CHECK OPTION for the temporal leftover
> > rows it inserts.
>
> [RMT hat]
>
> It's been a few weeks since this was reported, and there hasn't been
> engagement by the feature authors. Is this on your radar?
> I added an open item [1].

Thanks Melanie! I'm sorry I missed this before.

I can reproduce the bug. The fix looks good to me.

Here are some slight revisions: I added doc updates and a couple extra
regress lines (verifying the same cases, but for UPDATE too). And I
expanded the comment to explain why this is needed for DELETE but not
UPDATE, since that wasn't obvious to me right away.

Seems reasonable to me, after a quick read through.

Regards,
Dean

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY TO regression with psql -c
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: BUG #19616: pgoutput sends stream abort ('A') to clients that did not enable streaming