Re: Max OID

From: Steve T <steve(at)retsol(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Max OID
Date: 2008-10-17 06:30:35
Message-ID: 1224225035.3598.478.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom,
OK - so what I'm seeing dumping a database from 8.0.8 and restoring it
under 8.1.10 isn't what I'd see if I dumped it and restored it all under
the same release of 8.0.8?

If I dump and restore under 8.0.8 you would expect the OIDs to be
reset?
If I then do the same (ie dump and restore) under 8.1.10 the OIDs used
would be preserved for where OIDS have been used? Does that also apply
to to the pg_ system tables?

The reason for these questions is that I had a server crash and restored
an 8.0.8 dump from the crashed server into an 8.0.8 instance on a backup
server. I didn't initdb the instance on the backupserver before doing
the restore and after the restore I had a problem with the OIDs being
much higher for the same records on the backup than it was on the
original. The programming language I use then had a problem retrieving
OID values > 2Billion (it always returned 2Billion exactly) - so the
application had a problem. I got around that particular issue.
But I now want to revert the OIDs to a 'smaller' value - so I had hoped
by dumping the database, initdb and restoring the DB (all under 8.0.8),
that it would reset the OIDS down. Would that be the case?

On Thu, 2008-10-16 at 16:02 -0400, Tom Lane wrote:

> Steve T <steve(at)retsol(dot)co(dot)uk> writes:
> > If I have a set of large objects and I have a pointer on a table to that
> > object, what happens to that pointer when the database is dumped and
> > restored?
>
> Nothing, if you're using a reasonably modern PG version (8.1 or later).
> pg_dump preserves the OIDs of large objects.
>
> In older versions dump/reload didn't preserve those OIDs, but instead
> pg_dump attempted to update stored OIDs to match the new values.
>
> regards, tom lane
>

Steve Tucknott
ReTSol Ltd

DDI: 01323 488548

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Steve T 2008-10-17 06:36:12 Re: Max OID
Previous Message Tom Lane 2008-10-16 20:02:06 Re: Max OID