Re: Unnecessary checks for new rows by some RI trigger functions? - Mailing list pgsql-hackers

From Antonin Houska
Subject Re: Unnecessary checks for new rows by some RI trigger functions?
Date
Msg-id 3735.1551079210@localhost
Whole thread Raw
In response to Re: Unnecessary checks for new rows by some RI trigger functions?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Not sure what I think about your new proposed patch.  What problem
> do you think it solves?  Also, don't think I believe this:
> 
> +         * crosscheck_snapshot is actually used only for UPDATE / DELETE
> +         * queries.

I wanted to clarify the meaning of crosscheck_snapshot, i.e. only set it when
it's needed. Anyway I don't feel now it's worth the amount of code changed.

> The commands we're issuing here are SELECT FOR UPDATE^H^H^HSHARE,
> and those should chase up to the newest row version and do a
> crosscheck just as UPDATE / DELETE would do.  If they don't, there's
> a hazard of mis-enforcing the FK constraint in the face of
> concurrent updates.

Maybe I missed something. When I searched through the code I saw the
crosscheck_snapshot passed only to heap_update() and heap_delete().

-- 
Antonin Houska
https://www.cybertec-postgresql.com


pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: reloption to prevent VACUUM from truncating empty pages at theend of relation
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Protect syscache from bloating with negative cache entries