OSDN Git Service

Add a RESTART (without parameter) option to ALTER SEQUENCE, allowing a
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 May 2008 23:36:05 +0000 (23:36 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 May 2008 23:36:05 +0000 (23:36 +0000)
commit10a3471bed7b57fb986a5be8afdee5f0dda419de
tree32de8db702827c67c5cb85479d9bbff22c7b6e94
parent8a2f5d221b0d6e41dc66b7e7389668bd208e3529
Add a RESTART (without parameter) option to ALTER SEQUENCE, allowing a
sequence to be reset to its original starting value.  This requires adding the
original start value to the set of parameters (columns) of a sequence object,
which is a user-visible change with potential compatibility implications;
it also forces initdb.

Also add hopefully-SQL-compatible RESTART/CONTINUE IDENTITY options to
TRUNCATE TABLE.  RESTART IDENTITY executes ALTER SEQUENCE RESTART for all
sequences "owned by" any of the truncated relations.  CONTINUE IDENTITY is
a no-op option.

Zoltan Boszormenyi
18 files changed:
doc/src/sgml/ref/alter_sequence.sgml
doc/src/sgml/ref/truncate.sgml
src/backend/catalog/pg_depend.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/bin/pg_dump/pg_dump.c
src/include/catalog/catversion.h
src/include/catalog/dependency.h
src/include/commands/sequence.h
src/include/nodes/parsenodes.h
src/test/regress/expected/sequence.out
src/test/regress/expected/truncate.out
src/test/regress/sql/sequence.sql
src/test/regress/sql/truncate.sql