Thread: OIDS

OIDS

From
Q Beukes
Date:
Hey,

I have a few questions/thoughts about OIDS.

1. What are the pros/cons of having them against not having them in your
table.
2. Are they unique throughout tables/database/postgres setup.
3. If they are unique throughout the system, a 4 byte integer can be used up
    pretty quickly in large/busy systems. How does postgres handle the
overflow?
4. I noticed that it must be the same "counter" that is used in all
INSERTS no matter what
    database you are in. And to accommodate for large databases having
unique oids,
    I figured postgres probably only makes them unique in tables. But if
it overflows
    how does postgres determine which OID this db/table hasn't used yet?

regards
Q Beukes



Re: OIDS

From
Bruno Wolff III
Date:
On Wed, May 17, 2006 at 14:21:47 +0200,
  Q Beukes <pgsql-novice@postgresql.org> wrote:
> Hey,
>
> I have a few questions/thoughts about OIDS.
>
> 1. What are the pros/cons of having them against not having them in your
> table.

Generally you don't want to use them. Use sequences/serial instead.

> 2. Are they unique throughout tables/database/postgres setup.

No. If you want to enforce uniqueness, you need to add a constraint and be
prepared to retry on failures.