public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected]
To: David G. Johnston <[email protected]>
To: Tom Lane <[email protected]>
Cc: Pg Docs <[email protected]>
Subject: Re: Foreign Keys being able to reference same table not spelled out in documentation
Date: Thu, 06 May 2021 08:07:39 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwZTke7+HUn4YUGqu2+gAPi4Cy18TXMrg_Z5nADkxfPNMw@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<CAKFQuwZTke7+HUn4YUGqu2+gAPi4Cy18TXMrg_Z5nADkxfPNMw@mail.gmail.com>
Note that it is in general not necessary for the referencing column to
be NULLABLE. If you defer the constraint checking, you can insert a
cyclic structure. Of course, it's no longer a tree then.
The tutorial-ness of the documentation was already pointed out and I
don't think it needs to be said there. We just would want to not imply
this (nullable) would be necessary.
Documentation-wise I liked to MariaDB approach very much, where the two
tables were named "parent table" and "child table" and at some point
you note that it is allowed for a table to be both. But this would be a
lot more invasive.
All the Best
Mario Wenzel
Am Mittwoch, dem 05.05.2021 um 21:17 -0700 schrieb David G. Johnston:
> On Thu, Apr 29, 2021 at 10:33 AM Tom Lane <[email protected]> wrote:
> > I'm inclined to propose adding an example a little further down, as
> > per the attached draft patch. This wouldn't help people who stop
> > reading after the section's first sentence, but we can't cover
> > everything in the first sentence.
> >
> >
>
>
> Given the tutorial nature of this section I agree with the approach.
>
> I did a read through of the patch and I like it; though I suggest
> changing "but non-NULL" to "while non-NULL".
>
> Thanks!
>
> David J.
>
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Foreign Keys being able to reference same table not spelled out in documentation
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox