Re: OID's

From: Matt <matt(at)kynx(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: OID's
Date: 2004-11-16 22:54:29
Message-ID: 1100645669.4227.82.camel@matt.kynx.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Re: OID's at 2004-11-16 20:44:43 from Greg Stark

Browse pgsql-general by date

  From Date Subject
Next Message matthias 2004-11-17 00:58:21 Problems importing Unicode
Previous Message Timothy Perrigo 2004-11-16 21:54:09 Re: question about temp table in function