Received: from lorica.ucc.usyd.edu.au (lorica.ucc.usyd.edu.au [129.78.64.15]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9S1O7P73865 for ; Sat, 27 Oct 2001 21:24:08 -0400 (EDT) (envelope-from david@netventures.com.au) Received: from localhost (p60758.net10.usyd.edu.au [10.0.237.86]) by lorica.ucc.usyd.edu.au (8.9.3/8.9.3) with ESMTP id MAA28573; Sun, 28 Oct 2001 12:24:00 +1100 (EST) Date: Sun, 28 Oct 2001 12:23:59 +1100 Subject: Re: serial data type Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v472) From: David Stanaway To: "PgSQL-SQL" , "postgresql" Content-Transfer-Encoding: 7bit In-Reply-To: <200110270135.f9R1ZmP66919@postgresql.org> Message-Id: <76B9DDD4-CB42-11D5-B24B-0003930FDAB2@netventures.com.au> X-Mailer: Apple Mail (2.472) X-Archive-Number: 200110/380 X-Sequence-Number: 5332 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@stanaway.net Work: david@netventures.com.au