Clarify temporal FK comments

Started by Paul A Jungwirthabout 1 month ago2 messages
#1Paul A Jungwirth
pj@illuminatedcomputing.com
1 attachment(s)

Hello,

In RI_ConstraintInfo, a couple new fields say they are operators for
anyrange, but technically they could be for anymultirange instead.
Here is a patch to fix that. (It's too bad that pgindent wants to
break the lines here.)

Yours,

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

Attachments:

v1-0001-Clarify-comment-about-temporal-foreign-keys.patchtext/x-patch; charset=US-ASCII; name=v1-0001-Clarify-comment-about-temporal-foreign-keys.patchDownload
From 4d539b5477273e7094d073034e0b80206875cda8 Mon Sep 17 00:00:00 2001
From: "Paul A. Jungwirth" <pj@illuminatedcomputing.com>
Date: Thu, 27 Nov 2025 12:13:55 -0800
Subject: [PATCH v1] Clarify comment about temporal foreign keys

In RI_ConstraintInfo, period_contained_by_oper and period_intersect_oper can
take either anyrange or anymultirange.

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
---
 src/backend/utils/adt/ri_triggers.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 059fc5ebf60..d54591fce58 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -126,9 +126,11 @@ typedef struct RI_ConstraintInfo
 	Oid			pf_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = FK) */
 	Oid			pp_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (PK = PK) */
 	Oid			ff_eq_oprs[RI_MAX_NUMKEYS]; /* equality operators (FK = FK) */
-	Oid			period_contained_by_oper;	/* anyrange <@ anyrange */
+	Oid			period_contained_by_oper;	/* anyrange <@ anyrange (or
+											 * multiranges) */
 	Oid			agged_period_contained_by_oper; /* fkattr <@ range_agg(pkattr) */
-	Oid			period_intersect_oper;	/* anyrange * anyrange */
+	Oid			period_intersect_oper;	/* anyrange * anyrange (or
+										 * multiranges) */
 	dlist_node	valid_link;		/* Link in list of valid entries */
 } RI_ConstraintInfo;
 
-- 
2.47.3

#2Peter Eisentraut
peter@eisentraut.org
In reply to: Paul A Jungwirth (#1)
Re: Clarify temporal FK comments

On 05.12.25 00:11, Paul A Jungwirth wrote:

In RI_ConstraintInfo, a couple new fields say they are operators for
anyrange, but technically they could be for anymultirange instead.
Here is a patch to fix that. (It's too bad that pgindent wants to
break the lines here.)

committed