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)
commit01ff9804fa19a01a17d76150de7a4041f0951103
treed18d0ada623e190e461c8905f693187b0638d739
parentb95f60d540a52fc75f0dd9769933c579a6ace959
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