From a0e842d81b435681a46e6dd1e50f14f9967ced37 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 25 Jun 2004 17:20:29 +0000 Subject: Add pg_get_serial_sequence() function, and cause pg_dump to use it. This eliminates the assumption that a serial column's sequence will have the same name on reload that it was given in the original database. Christopher Kings-Lynne --- doc/src/sgml/func.sgml | 65 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 21 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 106c4cf775f..3c23f43a59f 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -7228,29 +7228,13 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); pg_get_userbyid + + pg_get_serial_sequence + + lists functions that extract information from the system catalogs. - pg_get_viewdef, - pg_get_ruledef, - pg_get_indexdef, - pg_get_triggerdef, and - pg_get_constraintdef respectively - reconstruct the creating command for a view, rule, index, trigger, or - constraint. (Note that this is a decompiled reconstruction, not - the original text of the command.) Most of these come in two - variants, one of which can optionally pretty-print the result. - The pretty-printed format is more readable, but the default format is more - likely to be - interpreted the same way by future versions of PostgreSQL; - avoid using pretty-printed output for dump purposes. - Passing false for the pretty-print parameter yields the - same result as the variant that does not have the parameter at all. - pg_get_expr decompiles the internal form of an - individual expression, such as the default value for a column. It - may be useful when examining the contents of system catalogs. - pg_get_userbyid - extracts a user's name given a user ID number. @@ -7335,10 +7319,49 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); nameget user name with given ID + + pg_get_serial_sequence(table_name, column_name) + text + get name of the sequence that a serial or bigserial column + uses +
+ + pg_get_viewdef, + pg_get_ruledef, + pg_get_indexdef, + pg_get_triggerdef, and + pg_get_constraintdef respectively + reconstruct the creating command for a view, rule, index, trigger, or + constraint. (Note that this is a decompiled reconstruction, not + the original text of the command.) + pg_get_expr decompiles the internal form of an + individual expression, such as the default value for a column. It + may be useful when examining the contents of system catalogs. + Most of these functions come in two + variants, one of which can optionally pretty-print the result. + The pretty-printed format is more readable, but the default format is more + likely to be + interpreted the same way by future versions of PostgreSQL; + avoid using pretty-printed output for dump purposes. + Passing false for the pretty-print parameter yields the + same result as the variant that does not have the parameter at all. + + + + pg_get_userbyid + extracts a user's name given a user ID number. + pg_get_serial_sequence + fetches the name of the sequence associated with a serial or + bigserial column. The name is suitably formatted + for passing to the sequence functions (see ). + NULL is returned if the column does not have a sequence attached. + + obj_description -- cgit v1.2.3