AW: [HACKERS] sequence creation - Mailing list pgsql-hackers

From Andreas Zeugswetter
Subject AW: [HACKERS] sequence creation
Date
Msg-id 01BDCB61.4EE5EF40@zeugswettera.user.lan.at
Whole thread Raw
Responses Re: AW: [HACKERS] sequence creation
List pgsql-hackers
>> Right now, we allow PRIMARY to auto-create an index.
>> Can we have something to auto-create sequences, instead of the more
>> complicated CREATE SEQUENCE process.
>> Perhaps use the data type SERIAL to autocreate a sequence.  Should
>> make life easier for novices.  We are getting too many sequence
>> questions.
>
>That would be possible. I'd be happier doing it for v6.5, since I'm
>hoping to work on docs in the meantime. Of course, maybe it would be
>easy :)
>
>What should the syntax be exactly?
>
>  CREATE TABLE t (s SERIAL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

exactly this. :-)    (like in Informix)

Informix also allows to specify a starting value like:
create table t (s serial(1000));
defaulting to 1 but I think this additional syntax is rather misleading

Andreas


pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] New Developer's FAQ item
Next
From: Maarten Boekhold
Date:
Subject: Re: [HACKERS] What does "cannot extend" mean?