OSDN Git Service

Change nextval and other sequence functions to specify their sequence
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Oct 2005 23:50:16 +0000 (23:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 2 Oct 2005 23:50:16 +0000 (23:50 +0000)
commitaa731ed8433914641e42f32fec0fcf27f01aab7e
tree7120217579cb1a88552c7a1ee44cc0a0749d6e3e
parent1b61ee3c69ccd869bddc56ae1021797a517ca9b7
Change nextval and other sequence functions to specify their sequence
argument as a 'regclass' value instead of a text string.  The frontend
conversion of text string to pg_class OID is now encapsulated as an
implicitly-invocable coercion from text to regclass.  This provides
backwards compatibility to the old behavior when the sequence argument
is explicitly typed as 'text'.  When the argument is just an unadorned
literal string, it will be taken as 'regclass', which means that the
stored representation will be an OID.  This solves longstanding problems
with renaming sequences that are referenced in default expressions, as
well as new-in-8.1 problems with renaming such sequences' schemas or
moving them to another schema.  All per recent discussion.
Along the way, fix some rather serious problems in dbmirror's support
for mirroring sequence operations (int4 vs int8 confusion for instance).
25 files changed:
contrib/dbmirror/MirrorSetup.sql
contrib/dbmirror/README.dbmirror
contrib/dbmirror/pending.c
doc/src/sgml/datatype.sgml
doc/src/sgml/func.sgml
doc/src/sgml/release.sgml
src/backend/catalog/dependency.c
src/backend/catalog/information_schema.sql
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/parser/analyze.c
src/backend/utils/adt/regproc.c
src/bin/psql/describe.c
src/include/catalog/catversion.h
src/include/catalog/pg_cast.h
src/include/catalog/pg_proc.h
src/include/commands/sequence.h
src/include/utils/builtins.h
src/test/regress/expected/domain.out
src/test/regress/expected/rules.out
src/test/regress/expected/sequence.out
src/test/regress/input/constraints.source
src/test/regress/output/constraints.source
src/test/regress/sql/domain.sql
src/test/regress/sql/sequence.sql