Doc: mention foreign keys can reference unique indexes
authorDavid Rowley
Mon, 29 Jan 2024 21:15:51 +0000 (10:15 +1300)
committerDavid Rowley
Mon, 29 Jan 2024 21:15:51 +0000 (10:15 +1300)
commit1c8336e3e2f35e3968f73afc3a78ff34aaa523e2
tree2456ec743a83ea609faea4f49bac8f683c128db5
parent1b924a86e696c25775e873ccd4cac1f24ec6502f
Doc: mention foreign keys can reference unique indexes

We seem to have only documented a foreign key can reference the columns of
a primary key or unique constraint.  Here we adjust the documentation
to mention columns in a non-partial unique index can be mentioned too.

The header comment for transformFkeyCheckAttrs() also didn't mention
unique indexes, so fix that too.  In passing make that header comment
reflect reality in the various other aspects where it deviated from it.

Bug: 18295
Reported-by: Gilles PARC
Author: Laurenz Albe, David Rowley
Discussion: https://www.postgresql.org/message-id/18295-0ed0fac5c9f7b17b%40postgresql.org
Backpatch-through: 12
doc/src/sgml/ddl.sgml
doc/src/sgml/ref/create_table.sgml
src/backend/commands/tablecmds.c