Search Postgresql Archives

Re: OID's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
> 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


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux