From ben.c@ect.com.au Tue Aug 26 03:45:18 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 83E12650060 for ; Tue, 26 Aug 2008 00:45:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 39158-03-2 for ; Tue, 26 Aug 2008 00:44:36 -0300 (ADT) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by postgresql.org (Postfix) with ESMTP id B710164FD15 for ; Tue, 26 Aug 2008 00:41:40 -0300 (ADT) X-Greylist: delayed 00:09:07.227163 by SQLgrey-1.7.6 Received: from ect.com.au (unknown [210.11.58.40]) by mx3.hub.org (Postfix) with ESMTP id ACDC137B553 for ; Tue, 26 Aug 2008 00:41:39 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9072C.12B0D8E8" Subject: Restoring Backup With OIDs As Primary Key Date: Tue, 26 Aug 2008 13:30:23 +1000 Message-ID: <7DA06115D1591D41A33328B737C1F4122F309E@svrect1.ect.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Restoring Backup With OIDs As Primary Key Thread-Index: AckHLBKiWUnF6Lz2RQ2Niwn2uKXUKA== From: "Ben C" To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200808/165 X-Sequence-Number: 30010 This is a multi-part message in MIME format. ------_=_NextPart_001_01C9072C.12B0D8E8 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I am trying to restore from a backup db that used oids as primary keys * = ... when I do this the max oid value in the new database is around the = 1700 mark where as the database I am pulling in is around 20,000,000 . = which means any new data added to the dataabse is going to be clobbered. Is there a way to increment the OID by changing a value in the system = tables?=20 thanks in advance * at the time this was implemented way back at 7.x, from what I had read = it seemed like acceptable practice :/ ------_=_NextPart_001_01C9072C.12B0D8E8 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Restoring Backup With OIDs As Primary Key

Hello,

I am trying to restore from a backup db that used oids as primary keys * = ... when I do this the max oid value in the new database is around the = 1700 mark where as the database I am pulling in is around 20,000,000 . = which means any new data added to the dataabse is going to be = clobbered.

Is there a way to increment the OID by changing a value in the system = tables?

thanks in advance

* at the time this was implemented way back at 7.x, from what I had read = it seemed like acceptable practice :/

------_=_NextPart_001_01C9072C.12B0D8E8-- From ajs@commandprompt.com Tue Aug 26 14:13:18 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 276AE650221 for ; Tue, 26 Aug 2008 11:13:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31434-02 for ; Tue, 26 Aug 2008 11:12:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id 7A2CF64FD64 for ; Tue, 26 Aug 2008 11:12:58 -0300 (ADT) Received: from commandprompt.com (CPE001b63afe888-CM001adea9c5a6.cpe.net.cable.rogers.com [99.236.211.160]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m7QEFv3P023791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 26 Aug 2008 07:16:00 -0700 Date: Tue, 26 Aug 2008 10:12:52 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org Subject: Re: Restoring Backup With OIDs As Primary Key Message-ID: <20080826141251.GP10936@commandprompt.com> Mail-Followup-To: Andrew Sullivan , pgsql-admin@postgresql.org References: <7DA06115D1591D41A33328B737C1F4122F309E@svrect1.ect.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7DA06115D1591D41A33328B737C1F4122F309E@svrect1.ect.local> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 26 Aug 2008 07:16:01 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/166 X-Sequence-Number: 30011 On Tue, Aug 26, 2008 at 01:30:23PM +1000, Ben C wrote: > > Is there a way to increment the OID by changing a value in the system tables? I don't think so, but I just tried creating a table in 8.3 with a column named "oid", and it worked. Maybe you can load in your data that way, so that you don't need to change your application. (I'd test it a little more carefully for side effects than I just did, mind.) A -- Andrew Sullivan ajs@commandprompt.com +1 503 667 4564 x104 http://www.commandprompt.com/ From alvherre@commandprompt.com Tue Aug 26 14:16:37 2008 Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 16D2F65011B for ; Tue, 26 Aug 2008 11:16:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31699-07 for ; Tue, 26 Aug 2008 11:16:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by postgresql.org (Postfix) with ESMTP id C117164FD64 for ; Tue, 26 Aug 2008 11:16:30 -0300 (ADT) Received: from perhan.alvh.no-ip.org (190-95-19-36.bk17-dsl.surnet.cl [190.95.19.36]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m7QEJSoj023953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Aug 2008 07:19:31 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 20EAB47C9B; Tue, 26 Aug 2008 10:16:22 -0400 (CLT) Date: Tue, 26 Aug 2008 10:16:22 -0400 From: Alvaro Herrera To: Ben C Cc: pgsql-admin@postgresql.org Subject: Re: Restoring Backup With OIDs As Primary Key Message-ID: <20080826141622.GB4920@alvh.no-ip.org> References: <7DA06115D1591D41A33328B737C1F4122F309E@svrect1.ect.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7DA06115D1591D41A33328B737C1F4122F309E@svrect1.ect.local> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Tue, 26 Aug 2008 07:19:31 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/167 X-Sequence-Number: 30012 Ben C wrote: > Is there a way to increment the OID by changing a value in the system tables? Not a system table, but you can with pg_resetxlog -o. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.