Re: OID's - Mailing list pgsql-general

From Matt
Subject Re: OID's
Date
Msg-id 1100645669.4227.82.camel@matt.kynx.org
Whole thread Raw
In response to Re: OID's  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
> How do you make use of this? It seems like you would need your code to know
> which foreign_oid referred to which table to actually perform the join.

Sorry, wasn't very clear about what it does:

select * from mytable t left join joinme j on t.id = j.foreign_id and
t.tableoid = j.foreign_oid;

I use it for 'PostIt note' type data that I want to be able to stick to
any other row in the DB. Keeping the referential integrity is a bit of
extra work, but I'm working on it :)

If you're going the other way, yes, you'll need to find out what tables
are joined to your postit first. But that's easy with:

select foreign_oid::regclass from joinme where...

But back to my original question: are those tableoid's going to suddenly
wrap around?

M


pgsql-general by date:

Previous
From: "Sim Zacks"
Date:
Subject: Re: Data from Internet direct into PostgeSQL Database??
Next
From: matthias@cmklein.de
Date:
Subject: Problems importing Unicode