Re: serial data type

From: David Stanaway <david(at)netventures(dot)com(dot)au>
To: "PgSQL-SQL" <pgsql-sql(at)postgresql(dot)org>, "postgresql" <pgsql(at)symcom(dot)com>
Subject: Re: serial data type
Date: 2001-10-28 01:23:59
Message-ID: 76B9DDD4-CB42-11D5-B24B-0003930FDAB2@netventures.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Saturday, October 27, 2001, at 11:44 AM, postgresql wrote:

>
> CREATE TABLE tablename (colname SERIAL);
>
> okay, but how do I set the beginning number. So far the only thing I
> have been able to do is directly after creating the serial column, I do:
>
> select setval('tablename_colname_seq', 15753);
>
> Is this the only way to set the beginning number of a sequence?

Try looking at the output of
pg_dump -s on this database.

You will see that the SERIAL type does not appear (Since this would
create a new sequence with an incorrect start value if the database was
restored from the dump).

You will also see how to create a sequence with different start values
and intervals.

==============================
David Stanaway
Personal: david(at)stanaway(dot)net
Work: david(at)netventures(dot)com(dot)au

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Aasmund Midttun Godal 2001-10-29 00:51:51 Re: oid's in views.
Previous Message Sheer El-Showk 2001-10-27 22:57:19 Re: performance tuning