pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: john@august.com
Cc: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] maximum number of rows in table - what about oid limits?
Date: Wed, 06 Jun 2001 18:37:00 -0400
Message-ID: <6257.991867020@sss.pgh.pa.us> (raw)
In-Reply-To: <20010606215234.97024.qmail@web10001.mail.yahoo.com>
References: <20010606215234.97024.qmail@web10001.mail.yahoo.com>

John Scott <jmscott@yahoo.com> writes:
> my question is, since oid's are used by the
> postgres kernel, what effect does oid wrapping have upon
> the stability of the database.

It doesn't affect stability, if by that you mean potential crashes.

What can happen after a wrap is that the OID generated for a
newly-created object might conflict with some already-existing object's
OID.  If that happens, you get a duplicate-key-insertion error on the
OID index of the relevant system catalog (pg_class, pg_type, etc).
There is a unique index on OID for each system catalog wherein OID
is used to identify objects.  It doesn't really matter whether the
same OID is reused in different catalogs or in user tables.

The odds of this happening seem pretty low, if you've got reasonable
numbers of objects (eg, with a couple thousand tables in a database,
you'd have a 2000/4G = 1 in 2 million chance of collision on pg_class
OID).  If it does happen, you can just retry the failed object-creation
command until you get a nonconflicting OID assignment.

This is certainly not ideal, but it's not nearly as big a problem as
transaction ID wraparound.  You can live with it, whereas right now
xact ID wraparound is catastrophic.  That we gotta work on, soon.

			regards, tom lane



view thread (25+ messages)  latest in thread

Message-ID: <6257.991867020@sss.pgh.pa.us>
Permalink:  ../6257.991867020@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6257.991867020@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john@august.com, sszabo@megazone23.bigpanda.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] maximum number of rows in table - what about oid limits?
  In-Reply-To: <6257.991867020@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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