agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Test what BEFORE UPDATE triggers do to FOR PORTION OF
2+ messages / 1 participants
[nested] [flat]

* pgsql: Test what BEFORE UPDATE triggers do to FOR PORTION OF
@ 2026-07-21 06:50 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-07-21 06:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Test what BEFORE UPDATE triggers do to FOR PORTION OF

If a BEFORE trigger changes NEW.valid_at, what is the interaction with
FOR PORTION OF?  This commit gives a test to capture our current
behavior: The trigger's change replaces the value we computed
automatically, but it does not change the bounds of the temporal
leftovers.

This matches the behavior of MariaDB.  On the other hand, DB2 rejects
changing the start/end columns of a PERIOD.  Since we don't have
PERIODs, we can't reject the change at trigger definition time as DB2
does, but we could reject it at run time by comparing the values
before and after running triggers.

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Discussion: https://www.postgresql.org/message-id/CA%2BrenyV3Cr9BvWsPeb1t8b%3DPk24apuzyGbubAEs_YsgLUTfXpg%40mail...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9170c8b71693cf76a4b9a9fbcd16b1fb20b3357c

Modified Files
--------------
src/test/regress/expected/for_portion_of.out | 47 ++++++++++++++++++++++++++++
src/test/regress/sql/for_portion_of.sql      | 47 ++++++++++++++++++++++++++++
2 files changed, 94 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Test what BEFORE UPDATE triggers do to FOR PORTION OF
@ 2026-07-21 06:50 Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2026-07-21 06:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Test what BEFORE UPDATE triggers do to FOR PORTION OF

If a BEFORE trigger changes NEW.valid_at, what is the interaction with
FOR PORTION OF?  This commit gives a test to capture our current
behavior: The trigger's change replaces the value we computed
automatically, but it does not change the bounds of the temporal
leftovers.

This matches the behavior of MariaDB.  On the other hand, DB2 rejects
changing the start/end columns of a PERIOD.  Since we don't have
PERIODs, we can't reject the change at trigger definition time as DB2
does, but we could reject it at run time by comparing the values
before and after running triggers.

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Discussion: https://www.postgresql.org/message-id/CA%2BrenyV3Cr9BvWsPeb1t8b%3DPk24apuzyGbubAEs_YsgLUTfXpg%40mail...

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5454fe4a6e77661384a9766e6d760bf3ec1c9b0f

Modified Files
--------------
src/test/regress/expected/for_portion_of.out | 47 ++++++++++++++++++++++++++++
src/test/regress/sql/for_portion_of.sql      | 47 ++++++++++++++++++++++++++++
2 files changed, 94 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-07-21 06:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-21 06:50 pgsql: Test what BEFORE UPDATE triggers do to FOR PORTION OF Peter Eisentraut <peter@eisentraut.org>
2026-07-21 06:50 pgsql: Test what BEFORE UPDATE triggers do to FOR PORTION OF Peter Eisentraut <peter@eisentraut.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox