X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5664A9FA5BE for ; Thu, 15 Jun 2006 14:31:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 23342-10 for ; Thu, 15 Jun 2006 14:31:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stash.illumen.com (unknown [64.207.29.137]) by postgresql.org (Postfix) with ESMTP id 1E1B29FA13E for ; Thu, 15 Jun 2006 14:31:37 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Re: General question regarding sequences (Serial columns) X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Thu, 15 Jun 2006 11:31:37 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] General question regarding sequences (Serial columns) Thread-Index: AcaQoQsJefqiA6qOTBOsXQsTY36fZgAAFl6Q From: "Benjamin Krajmalnik" To: "Juan Miguel Paredes" , X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/129 X-Sequence-Number: 22091 Thanks. I just looked at the definition and see it is a default value, so I should be safe just pumping the data over. On completion of the import I plan to reseed he sequence generator. -----Original Message----- From: Juan Miguel Paredes [mailto:juan.paredes@gmail.com]=20 Sent: Thursday, June 15, 2006 11:28 AM To: Benjamin Krajmalnik Subject: Re: [ADMIN] General question regarding sequences (Serial columns) > If I were to use the former (use Serial/BigSerial), is there a command > which I can issue to keep PostgreSQL from using the sequence, and > therefore copying over the original identity field value? Something > equivalent to SQL Server's "SET IDENTITY_INSERT" command? "Serial" declares your column being an integer type and provides a default value (the next value from the sequence). If you DO provide a value for your id column, PostgreSQL won't use the sequence. However, be careful to keep in sync your sequence with the values in your table, to avoid collissions (ALTER SEQUENCE can help) Regards.