From a208ea72bced456c4234644e4c9eda8969e8bdc9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 16 Aug 2002 23:01:21 +0000 Subject: Modify pg_dump to dump foreign-key constraints as constraints, not as sets of triggers. Also modify psql \d command to show foreign key constraints as such and hide the triggers. pg_get_constraintdef() function added to backend to support these. From Rod Taylor, code review and some editorialization by Tom Lane. --- doc/src/sgml/func.sgml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f136088fe84..bf2ce4667e2 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -5521,6 +5521,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); text Get CREATE INDEX command for index + + pg_get_constraintdef(constraintOID) + text + Get definition of a constraint + pg_get_userbyid(userid) name @@ -5542,16 +5547,25 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); pg_get_indexdef + + pg_get_constraintdef + + pg_get_userbyid These functions extract information from the system catalogs. - pg_get_viewdef(), pg_get_ruledef(), and - pg_get_indexdef() respectively reconstruct the creating - command for a view, rule, or index. (Note that this is a decompiled + pg_get_viewdef(), + pg_get_ruledef(), + pg_get_indexdef(), and + pg_get_constraintdef() respectively reconstruct the + creating command for a view, rule, index, or constraint. + (Note that this is a decompiled reconstruction, not the verbatim text of the command.) + At present pg_get_constraintdef() only works for + foreign-key constraints. pg_get_userbyid() extracts a user's name given a usesysid value. -- cgit v1.2.3