Improve error message of FOR PORTION OF violations of WITH CHECK OPTION - Mailing list pgsql-hackers

From Paul A Jungwirth
Subject Improve error message of FOR PORTION OF violations of WITH CHECK OPTION
Date
Msg-id CA+renyWWv28ZKOuPfihjx4WwpMipkka92VephKfGZzL0Ts6acQ@mail.gmail.com
Whole thread
Responses AW: Increased SECURITY RISCS from omitting some compikler options when building PG with meson; e.g. -fcf-protection=full
List pgsql-hackers
Hi Hackers,

Here is a fix for finding D11 from [0].

When FOR PORTION OF through a view violates WITH CHECK OPTION *both*
by the updated row and by the inserted temporal leftover, we show an
error complaining about the leftover. It would be clearer to show an
error about the top-level row. This commit moves the check a little
earlier (but still after constraints & uniqueness violations), when
FOR PORTION OF is used.

I think this patch would be simpler if we unconditionally shuffled the
order in ExecUpdateEpilogue to be (1) ExecWithCheckOptions, (2)
ExecForPortionOfLeftovers, (3) ExecARUpdateTriggers. I couldn't find
any problems there. But it felt too drastic so close to release. If
you'd like that patch instead, I'll send a revision.

[0] https://www.postgresql.org/message-id/CA%2BrenyV6QLOJYmLo3gbsg1Y%2BCrho8NqME1jJXgPbO_NgxfBaKQ%40mail.gmail.com

Yours,

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com

Attachment

pgsql-hackers by date:

Previous
From: Kirk Wolak
Date:
Subject: Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation
Next
From: Zsolt Parragi
Date:
Subject: Re: Introducing find_all_inheritors_ordered()