X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 73C9F528C6 for ; Fri, 17 Jun 2005 17:04:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10628-07 for ; Fri, 17 Jun 2005 20:04:13 +0000 (GMT) Received: from ylpvm25.prodigy.net (ylpvm25-ext.prodigy.net [207.115.57.56]) by svr1.postgresql.org (Postfix) with ESMTP id A9EB6528D9 for ; Fri, 17 Jun 2005 17:04:12 -0300 (ADT) Received: from bitstream.cityblueprinting.com (bitstream.cityblueprinting.com [68.252.88.58]) by ylpvm25.prodigy.net (8.12.10 auth mps linux/8.12.10) with ESMTP id j5HK4feL016309 for ; Fri, 17 Jun 2005 16:04:41 -0400 Received: from John (unknown [192.168.1.16]) by bitstream.cityblueprinting.com (Postfix) with ESMTP id A04F0D2 for ; Fri, 17 Jun 2005 15:48:06 -0400 (EDT) From: "John Scalia" To: Subject: getting a sequence to update properly Date: Fri, 17 Jun 2005 16:04:12 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005A_01C57356.34344670" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 Thread-Index: AcVzd7sDE2giuXSpRrCwp0N9tcDbZg== Message-Id: <20050617194806.A04F0D2@bitstream.cityblueprinting.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=HTML_30_40, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200506/144 X-Sequence-Number: 17899 This is a multi-part message in MIME format. ------=_NextPart_000_005A_01C57356.34344670 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm trying to add a sequence function to an already existing field. All the 4000 records for this table currently have a value already in this field, but I'd like new ones to just get the next value by default as opposed to users being forced to type something. What I'd like to do is to reload this table and get the field to be updated by the sequence on the reload. I thought that by dumping the table with pg_dump and reloading with the generated datafile, this would happen, but the sequence's last_value field didn't change. Apparently, the values contained in the dump file won't update the sequence. Short of thoroughly massaging the datafile generated by the dump and turning all those record lines into SQL INSERT statements, is there any way to effectively update a field for an existing record so that the field gets the value from the sequence? I would normally just set minimum value to something greater than what already in the table, but the manually keyed values are all over the place, and I guess I'd really like to remove the gaps in the current values. -- John ------=_NextPart_000_005A_01C57356.34344670 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
I'm = trying to add a=20 sequence function to an already existing field. All the 4000 records for = this=20 table currently have a value already in this field, but I'd like new = ones to=20 just get the next value by default as opposed to users being forced to = type=20 something. What I'd like to do is to reload this table and get the field = to be=20 updated by the sequence on the reload. I thought that by dumping the = table with=20 pg_dump and reloading with the generated datafile, this would happen, = but the=20 sequence's last_value field didn't change. Apparently, the values = contained in=20 the dump file won't update the sequence. Short of thoroughly massaging = the=20 datafile generated by the dump and turning all those record lines into = SQL=20 INSERT statements, is there any way to effectively update a field for an = existing record so that the field gets the value from the = sequence? I=20 would  normally just set minimum value to something greater than = what=20 already in the table, but the manually keyed values are all over the = place, and=20 I guess I'd really like to remove the gaps in the current=20 values.
--
John
------=_NextPart_000_005A_01C57356.34344670--