Re: OIDs depending data -- how to dump/restore?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: "fkater(at)googlemail(dot)com" <fkater(at)googlemail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: OIDs depending data -- how to dump/restore?
Date: 2010-03-14 16:40:51
Message-ID: 4B9D1193.5090509@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 14/03/2010 16:21, fkater(at)googlemail(dot)com wrote:

> (2)
> If I need to go the long way and replace the OIDs with
> SERIALs first, updating all relations to it etc: Would a
> dump/restore then restore the original values in a SERIAL
> column?

So-called SERIAL types are actually just integer columns which take
nextval('some_sequence') as their DEFAULT, so yes - if you first replace
your OIDs with serials, the values will still be there after a dump/restore.

This is probably the more robust way to go long-term.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-03-14 17:09:55 Re: hardware for a server
Previous Message fkater@googlemail.com 2010-03-14 16:21:06 OIDs depending data -- how to dump/restore?