From: Paul Jungwirth <pj@illuminatedcomputing.com>
To: Bruce Momjian <bruce@momjian.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: PERIOD foreign key feature
Date: Wed, 8 May 2024 20:47:45 -0700
Message-ID: <04938501-fc8f-46f3-97a4-9a81a3f24530@illuminatedcomputing.com> (raw)
In-Reply-To: <ZjuPwWh7JWDnHR5J@momjian.us>
References: <ZjpApuq8I9DE5Elv@momjian.us>
<CAKFQuwZZObJj964eRkw6=kEEA3S_WQiz4Z+r4kk_yEaH9-r_tw@mail.gmail.com>
<4a630353-11bb-4e3a-ae61-5ec10abe7aed@illuminatedcomputing.com>
<0e2bd199-aea7-43ea-9700-a92db04bc71b@eisentraut.org>
<ZjuPwWh7JWDnHR5J@momjian.us>
On 5/8/24 07:44, Bruce Momjian wrote:
> On Wed, May 8, 2024 at 02:29:34PM +0200, Peter Eisentraut wrote:
>>> Yes, David is correct here on all points. I like his suggestion to
>>> clarify the language here also. If you need a patch from me let me know,
>>> but I assume it's something a committer can just make happen?
>>
>> In principle yes, but it's also very helpful if someone produces an actual
>> patch file, with complete commit message, credits, mailing list link, etc.
>
> I am ready to do the work, but waited a day for Peter to reply, since he
> was the author of the text.
Here is a patch for this.
Yours,
--
Paul ~{:-)
pj@illuminatedcomputing.com
Attachments:0001-Reword-docs-for-temporal-PKs-with-implicit-referent.patch (text/x-patch, 2.1K) download
From d97a60b7e56c57a242668609c8fb82e6a6a32506 Mon Sep 17 00:00:00 2001
From: "Paul A. Jungwirth" <pj@illuminatedcomputing.com>
Date: Wed, 8 May 2024 20:41:05 -0700
Subject: [PATCH] Reword docs for temporal PKs with implicit referent
The old docs had confusing language about "one side" of the foreign key,
which could mean either the referenced primary key itself or the
REFERENCES clause of the FK declaration.
Author: David G. Johnston <david.g.johnston@gmail.com>
Discussion: https://www.postgresql.org/message-id/ZjpApuq8I9DE5Elv%40momjian.us
---
doc/src/sgml/ref/create_table.sgml | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgmlindex 02f31d2d6fd..75f06bc49cc 100644--- a/doc/src/sgml/ref/create_table.sgml+++ b/doc/src/sgml/ref/create_table.sgml@@ -1184,11 +1184,13 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
referent for its entire duration. This column must be a range or
multirange type. In addition, the referenced table must have a primary
key or unique constraint declared with <literal>WITHOUT
- OVERLAPS</literal>. Finally, if one side of the foreign key uses- <literal>PERIOD</literal>, the other side must too. If the <replaceable- class="parameter">refcolumn</replaceable> list is omitted, the- <literal>WITHOUT OVERLAPS</literal> part of the primary key is treated- as if marked with <literal>PERIOD</literal>.+ OVERLAPS</literal>. Finally, if the foreign key has a PERIOD+ <replaceable class="parameter">column_name</replaceable> specification+ the corresponding <replaceable class="parameter">refcolumn</replaceable>,+ if present, must also be marked <literal>PERIOD</literal>. If the+ <replaceable class="parameter">refcolumn</replaceable> clause is omitted,+ and thus the reftable's primary key constraint chosen, the primary key+ must have its final column marked <literal>WITHOUT OVERLAPS</literal>.
</para>
<para>
--
2.42.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pj@illuminatedcomputing.com, bruce@momjian.us, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org
Subject: Re: PERIOD foreign key feature
In-Reply-To: <04938501-fc8f-46f3-97a4-9a81a3f24530@illuminatedcomputing.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox