From caede71b447971399011ef7687f4c68fe5ac9fc6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 17 May 2008 01:20:39 +0000 Subject: Allow ALTER SEQUENCE START WITH to change the recorded start_value of a sequence. This seems an obvious extension to the recent patch, and it makes the code noticeably cleaner and more orthogonal. --- doc/src/sgml/ref/alter_sequence.sgml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_sequence.sgml b/doc/src/sgml/ref/alter_sequence.sgml index 31e64dac35d..7cf69e9ea3f 100644 --- a/doc/src/sgml/ref/alter_sequence.sgml +++ b/doc/src/sgml/ref/alter_sequence.sgml @@ -1,5 +1,5 @@ @@ -26,7 +26,9 @@ PostgreSQL documentation ALTER SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] - [ RESTART [ [ WITH ] start ] ] [ CACHE cache ] [ [ NO ] CYCLE ] + [ START [ WITH ] start ] + [ RESTART [ [ WITH ] restart ] ] + [ CACHE cache ] [ [ NO ] CYCLE ] [ OWNED BY { table.column | NONE } ] ALTER SEQUENCE name RENAME TO new_name ALTER SEQUENCE name SET SCHEMA new_schema @@ -110,17 +112,31 @@ ALTER SEQUENCE name SET SCHEMA start + + + The optional clause START WITH start changes the + recorded start value of the sequence. This has no effect on the + current sequence value; it simply sets the value + that future ALTER SEQUENCE RESTART commands will use. + + + + + + restart The optional clause RESTART [ WITH start ] changes the + class="parameter">restart ] changes the current value of the sequence. This is equivalent to calling the setval function with is_called = false: the specified value will be returned by the next call of nextval. Writing RESTART with no start value is equivalent to supplying - the start value used when the sequence was created. + class="parameter">restart value is equivalent to supplying + the start value that was recorded by CREATE SEQUENCE + or last set by ALTER SEQUENCE START WITH. @@ -261,7 +277,8 @@ ALTER SEQUENCE serial RESTART WITH 105; ALTER SEQUENCE conforms to the SQL - standard, except for the OWNED BY, RENAME, and + standard, except for the START WITH, + OWNED BY, RENAME, and SET SCHEMA clauses, which are PostgreSQL extensions. -- cgit v1.2.3