Received: from web20806.mail.yahoo.com (web20806.mail.yahoo.com [216.136.226.195]) by postgresql.org (Postfix) with SMTP id DBE0047597B for ; Thu, 21 Mar 2002 15:34:13 -0500 (EST) Message-ID: <20020321203413.58637.qmail@web20806.mail.yahoo.com> Received: from [68.14.98.218] by web20806.mail.yahoo.com via HTTP; Thu, 21 Mar 2002 12:34:13 PST Date: Thu, 21 Mar 2002 12:34:13 -0800 (PST) From: Jeff Eckermann Subject: Re: Sequence not updated after a copy ? To: GRIMOIS Eric , pgsql-sql@postgresql.org In-Reply-To: <000c01c1d0fc$e36d1f40$3d04a837@PXXXX> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200203/284 X-Sequence-Number: 7163 --- GRIMOIS Eric wrote: > Hi All > > Does 'COPY table FROM...' command update the > last_value field of the > sequence(s) related to the table ? No. I assume you have specified values in your source file that take the place of the sequence-supplied values, otherwise the COPY operation would almost certainly fail. > Is a setval( ) function required after completion ? Yes: preferably before, if you want the sequence to be available to other users while you are doing the import. > In this case, what's the > best command for doing that ? I can't find the reference in the docs just now, but I believe it's: SELECT setval ('sequence_name', new_value); > > Thanks > > Eric GRIMOIS > Analyste programmeur > SEI - CPAM du Val d'Oise > 01.34.22.24.56 > > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please > send an appropriate > subscribe-nomail command to majordomo@postgresql.org > so that your > message can get through to the mailing list cleanly __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/