Re: Using oids - Mailing list pgsql-general

From Jonathan Bartlett
Subject Re: Using oids
Date
Msg-id Pine.GSU.4.44.0309031300270.23907-100000@eskimo.com
Whole thread Raw
In response to Re: Using oids  (Bo Lorentsen <bl@netgroup.dk>)
List pgsql-general
> No it don't know anything about the table it insert into. I simply do
> the following :
>
> 1. INSERT data (comming from another layer)
> 2. Get the last oid
> 3. SELECT * FROM the same table where oid = what I just found.
>
> I know absolutly nothing about the table, and I like it this way :-)

The way I do it is to have a global sequence called 'objects' that spits
out 64-bit values, and then EVERY TABLE has a 64-bit field called
object_id, which defaults to nextval('objects') if I don't specify it.
So, on every table no matter what, I could do:

1. select nextval('objects');
2. INSERT data (comming from another layer, but set object_id to the
value I got in #1)
3. SELECT * FROM the same table where oid = what I just selected in #1

Jon


pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: Using oids
Next
From: Bo Lorentsen
Date:
Subject: Re: Using oids