]> granicus.if.org Git - postgresql/commit
The following patch finishes primary key support. Previously, when
authorBruce Momjian <bruce@momjian.us>
Thu, 21 Jan 1999 22:48:20 +0000 (22:48 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 21 Jan 1999 22:48:20 +0000 (22:48 +0000)
commitc91dbcc5c7b64aecfc0a246d0f8f2d60145e6326
tree302cd1a2f305a40d4cfa001d3e74b5db9cf9f68c
parent7311da9ec48d6ed918cdede7be3c67817107301b
The following patch finishes primary key support.  Previously, when
a field was labelled as a primary key, the system automatically
created a unique index on the field.  This patch extends it so
that the index has the indisprimary field set.  You can pull a list
of primary keys with the followiing select.

SELECT pg_class.relname, pg_attribute.attname
    FROM pg_class, pg_attribute, pg_index
    WHERE pg_class.oid = pg_attribute.attrelid AND
        pg_class.oid = pg_index.indrelid AND
        pg_index.indkey[0] = pg_attribute.attnum AND
        pg_index.indisunique = 't';

There is nothing in this patch that modifies the template database to
set the indisprimary attribute for system tables.  Should they be
changed or should we only be concerned with user tables?

D'Arcy
src/backend/bootstrap/bootparse.y
src/backend/catalog/index.c
src/backend/commands/cluster.c
src/backend/commands/defind.c
src/backend/parser/analyze.c
src/backend/storage/large_object/inv_api.c
src/backend/tcop/utility.c
src/include/catalog/index.h
src/include/commands/defrem.h
src/include/nodes/parsenodes.h