Add TG_* vars for FOR PORTION OF - Mailing list pgsql-hackers

From Paul A Jungwirth
Subject Add TG_* vars for FOR PORTION OF
Date
Msg-id CA+renyU3XXv+7cB7xrbG4BM5p4o2X8yao5gw2vNvm3UeZ0HKQg@mail.gmail.com
Whole thread
Responses Re: Tepid: selective index updates for heap relations
List pgsql-hackers
Dear Hackers,

Here are patches adding new TG_* vars to PL/pgSQL, PL/Python, PL/Perl,
and PL/Tcl, holding FOR PORTION OF details. These let triggers respond
appropriately when FOR PORTION OF is used in the original query. That
is useful for replication, auditing, and general functionality. We
ourselves need this information for temporal foreign key actions (but
in C, not in a PL)[0]. This also came up a few times in the v19 beta
feedback to FOR PORTION OF. In particular, it would help to include
FOR PORTION OF information even for INSERT triggers fired because of
the temporal leftovers.

Patch 1 is the same as patch 2 from [0], but I'm repeating it here so
that the main patches compile.

The PL/pgSQL patch is fairly mature: I've been including it in
valid-time submissions for at least a few years now. The other PL/*
patches are new. They don't have to all be committed together, but I
think we should make the behavior as consistent as possible across
languages, so one commitfest entry seems best.

For Tcl, it's hard for me to judge if I'm presenting the information
in an idiomatic way. Any feedback would be appreciated!

[0] https://www.postgresql.org/message-id/CA%2BrenyUts-ksRKL3V%2B9kTnRCAJdb8Xc3T1L%2ByCVscNZQKT4Yvw%40mail.gmail.com

Yours,

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

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Commit Sequence Numbers and Visibility
Next
From: Bharath Rupireddy
Date:
Subject: Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views