Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key
Date
Msg-id CAApHDvpMps521Pih_ccrffzyv0SFtC0TuB6vULqhrrxzfW+o3w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-bugs
On Sat, 27 Jan 2024 at 01:14, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> Attached is a modified patch.

I think it looks mostly fine.

I'd only adjust the following addition to be a new paragraph:

-   <title>Foreign-Key Constraint Actions</title>
+   <title>Foreign-Key Constraints</title>

    <para>
     The ability to specify column lists in the foreign-key actions
     <literal>SET DEFAULT</literal> and <literal>SET NULL</literal> is a
     <productname>PostgreSQL</productname> extension.
+    It is also a <productname>PostgreSQL</productname> extension that a
+    foreign key constraint may reference a unique index instead of a
+    primary key or unique constraint.
    </para>

and drop the "also" at the same time.

I also noticed that, generally, we're not that consistent if we spell
it "foreign-key" or "foreign key".  You're introducing "foreign key"
in a location where there are a couple of "foreign-key"s. Maybe it's
better to be consistent in at least that location?

David



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18313: No error triggered when subtracting an interval from a timestamp
Next
From: Laurenz Albe
Date:
Subject: Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key