Re: Foreign Keys being able to reference same table not spelled out in documentation

From: maweki(at)gmail(dot)com
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Foreign Keys being able to reference same table not spelled out in documentation
Date: 2021-05-06 06:07:39
Message-ID: a9f4021f4a762a4d0cfaed2477f53c6e772c876a.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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 <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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.
>

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2021-05-06 13:59:38 Re: Foreign Keys being able to reference same table not spelled out in documentation
Previous Message David G. Johnston 2021-05-06 04:17:05 Re: Foreign Keys being able to reference same table not spelled out in documentation