diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-02 23:50:16 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-10-02 23:50:16 +0000 |
commit | aa731ed8433914641e42f32fec0fcf27f01aab7e (patch) | |
tree | 7120217579cb1a88552c7a1ee44cc0a0749d6e3e /src/include/commands/sequence.h | |
parent | 1b61ee3c69ccd869bddc56ae1021797a517ca9b7 (diff) |
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).
Diffstat (limited to 'src/include/commands/sequence.h')
-rw-r--r-- | src/include/commands/sequence.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h index 38538236c7a..13cbdc403ff 100644 --- a/src/include/commands/sequence.h +++ b/src/include/commands/sequence.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.32 2005/06/07 07:08:35 neilc Exp $ + * $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.33 2005/10/02 23:50:12 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -81,10 +81,11 @@ typedef struct xl_seq_rec } xl_seq_rec; extern Datum nextval(PG_FUNCTION_ARGS); -extern Datum currval(PG_FUNCTION_ARGS); +extern Datum nextval_oid(PG_FUNCTION_ARGS); +extern Datum currval_oid(PG_FUNCTION_ARGS); +extern Datum setval_oid(PG_FUNCTION_ARGS); +extern Datum setval3_oid(PG_FUNCTION_ARGS); extern Datum lastval(PG_FUNCTION_ARGS); -extern Datum setval(PG_FUNCTION_ARGS); -extern Datum setval_and_iscalled(PG_FUNCTION_ARGS); extern void DefineSequence(CreateSeqStmt *stmt); extern void AlterSequence(AlterSeqStmt *stmt); |