Re: BUG #18295: In PostgreSQL a unique index on targeted columns is sufficient to support a foreign key

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David Rowley <dgrowleyml@gmail.com>
Cc: gparc@free.fr, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2024-01-29T08:59:05Z
Lists: pgsql-bugs
Thanks for your updated patch!

On Mon, 2024-01-29 at 21:42 +1300, David Rowley wrote:

> I also ended up fiddling with the "foreign-key" vs "foreign key"
> thing. I didn't expect you to change the existing ones and on changing
> the new one to "foreign-key", I thought it looked weird.  Maybe we
> need a master-only patch to make these consistent...

Hm.  With your changes, the title reads "Foreign-Key Constraints", but
the body uses "foreign key constraint".  I think they should be consistent.

I'd be happy with either variant, but since the hyphenated version
isn't used anywhere else on the page, my opinion is that we should do
away with it.

Other than that, your patch looks good to me.

Yours,
Laurenz Albe



Commits

  1. Doc: mention foreign keys can reference unique indexes