pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedRestoring Backup With OIDs As Primary Key
3+ messages / 3 participants
[nested] [flat]
* Restoring Backup With OIDs As Primary Key
@ 2008-08-26 03:30 Ben C <ben.c@ect.com.au>
0 siblings, 2 replies; 3+ messages in thread
From: Ben C @ 2008-08-26 03:30 UTC (permalink / raw)
To: pgsql-admin
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 :/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Restoring Backup With OIDs As Primary Key
@ 2008-08-26 14:12 Andrew Sullivan <ajs@commandprompt.com>
parent: Ben C <ben.c@ect.com.au>
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Sullivan @ 2008-08-26 14:12 UTC (permalink / raw)
To: pgsql-admin
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/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Restoring Backup With OIDs As Primary Key
@ 2008-08-26 14:16 Alvaro Herrera <alvherre@commandprompt.com>
parent: Ben C <ben.c@ect.com.au>
1 sibling, 0 replies; 3+ messages in thread
From: Alvaro Herrera @ 2008-08-26 14:16 UTC (permalink / raw)
To: Ben C <ben.c@ect.com.au>; +Cc: pgsql-admin
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2008-08-26 14:16 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-08-26 03:30 Restoring Backup With OIDs As Primary Key Ben C <ben.c@ect.com.au>
2008-08-26 14:12 ` Andrew Sullivan <ajs@commandprompt.com>
2008-08-26 14:16 ` Alvaro Herrera <alvherre@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox