Re: Using oids

From: Darko Prenosil <darko(dot)prenosil(at)finteh(dot)hr>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using oids
Date: 2003-09-03 16:48:37
Message-ID: 200309031848.37246.darko.prenosil@finteh.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wednesday 03 September 2003 17:24, Bo Lorentsen wrote:
> On Wed, 2003-09-03 at 16:13, Tom Lane wrote:
> > The reason OIDs shouldn't be considered unique is that there is no
> > mechanism to enforce that they are unique --- unless you make one,
> > that is, create a unique index on OID for a table. The system does
> > not do that for you since it would be excessive overhead for tables
> > in which the user doesn't care about OID uniqueness. But I'd
> > definitely recommend it if you are using OIDs for row identifiers.
>
> Ok, so my little INSERT / SELECT show will continue to work for a long
> time, as I only uses the oids on short term bacis.
>
> > If you want a globally unique ID based on OIDs, use the table OID
> > concatenated with the row OID.
>
> Ok, this make sense !
>
> > No, there isn't. There is only ctid, which is not useful as a long-term
> > row identifier, because UPDATE and VACUUM can change it.
>
> But there is no way for the client user to user these in a
> "PQgetLastCtid" and "SELECT * from zxy where ctid = 42", so this will
> not help :-)
>
> Thanks anyway, may oid's live for a long time, and one day become grown
> up 64 bit values :-)
>
Any other way, a lot of (my) code will become useless :-(

Regards !

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-09-03 16:56:21 Web page for selecting presentations
Previous Message Ron Johnson 2003-09-03 16:36:38 Re: What is the good equivalent for ENUM ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2003-09-03 17:03:29 Re: libpq makefile for bcc
Previous Message Bruno Wolff III 2003-09-03 16:26:52 Re: Using oids