]> granicus.if.org Git - postgresql/commit
Add system catalog columns pg_constraint.conindid and pg_trigger.tgconstrindid.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Jul 2009 02:56:31 +0000 (02:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Jul 2009 02:56:31 +0000 (02:56 +0000)
commitc1b9ec24efb5d576800fb5163acab6bdefb4391c
tree794244f01dbc2ebd663513115b7a08c9d9fa0141
parent36942504fc7d0738191573225cc9d8e905a74f4b
Add system catalog columns pg_constraint.conindid and pg_trigger.tgconstrindid.

conindid is the index supporting a constraint.  We can use this not only for
unique/primary-key constraints, but also foreign-key constraints, which
depend on the unique index that constrains the referenced columns.
tgconstrindid is just copied from the constraint's conindid field, or is
zero for triggers not associated with constraints.

This is mainly intended as infrastructure for upcoming patches, but it has
some virtue in itself, since it exposes a relationship that you formerly
had to grovel in pg_depend to determine.  I simplified one information_schema
view accordingly.  (There is a pg_dump query that could also use conindid,
but I left it alone because it wasn't clear it'd get any faster.)
15 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/trigger.sgml
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/information_schema.sql
src/backend/catalog/pg_constraint.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/commands/typecmds.c
src/backend/tcop/utility.c
src/include/catalog/catversion.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_trigger.h
src/include/commands/trigger.h
src/include/utils/rel.h