CREATE SEQUENCE with RESTART option - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject CREATE SEQUENCE with RESTART option
Date
Msg-id CALj2ACV=AC6jHwobX-mqL-jBs6qhqzppD0tCmp8vHiLDrFRuyQ@mail.gmail.com
Whole thread Raw
Responses Re: CREATE SEQUENCE with RESTART option  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
Hi,

It looks like we do allow $subject which has following behaviour:
create sequence myseq restart 200;    --> sequence is starting from
restart value overriding start value
create sequence myseq start 100 restart 200; --> sequence is starting
from restart value overriding start value
create sequence myseq start 100 restart; --> sequence is starting from
start value no overriding of start value occurs
create sequence myseq restart; --> sequence is starting from default
start value no overriding of start value occurs

While we have documented the "restart" option behaviour for ALTER
SEQUENCE, we have no mention of it in the CREATE SEQUENCE docs page.
Do we need to document the above behaviour for CREATE SEQUENCE?
Alternatively, do we need to throw an error if the user is not
supposed to use the "restart" option with CREATE SEQUENCE?

IMO, allowing the "restart" option for CREATE SEQUENCE doesn't make
sense when we have the "start" option, so it's better to throw an
error.

Thoughts?

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Yet another fast GiST build
Next
From: Bharath Rupireddy
Date:
Subject: Why is specifying oids = false multiple times in create table is silently ignored?