postgresql/src/bin/initdb
Peter Eisentraut dfb75e478c Add primary keys and unique constraints to system catalogs
For those system catalogs that have a unique indexes, make a primary
key and unique constraint, using ALTER TABLE ... PRIMARY KEY/UNIQUE
USING INDEX.

This can be helpful for GUI tools that look for a primary key, and it
might in the future allow declaring foreign keys, for making schema
diagrams.

The constraint creation statements are automatically created by
genbki.pl from DECLARE_UNIQUE_INDEX directives.  To specify which one
of the available unique indexes is the primary key, use the new
directive DECLARE_UNIQUE_INDEX_PKEY instead.  By convention, we
usually make a catalog's OID column its primary key, if it has one.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com
2021-01-30 19:44:29 +01:00
..
po Translation updates 2020-05-18 12:49:30 +02:00
t Initial pgperltidy run for v12. 2019-05-22 13:36:19 -04:00
.gitignore Move wchar.c and encnames.c to src/common/. 2020-01-16 15:58:55 -05:00
findtimezone.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
initdb.c Add primary keys and unique constraints to system catalogs 2021-01-30 19:44:29 +01:00
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
nls.mk Translation updates 2020-05-11 13:14:32 +02:00