Subject: oid

From: [email-masked] (Raymond D. Frost)
Date: Wed, 26 Feb 92 11:16:10 -0800

A recent posting states that oid's are unique across the entire
database.  Is there a way to retrieve a record assuming that you
know its oid but do not know which class the record is a member of?

Raymond Frost
University of Miami

---

From: postarch (Postgres Mailing Archive)
Date: Tue, 03 Mar 92 11:45:58 PST

> know its oid but do not know which class the record is a member of?

Yes, but it might not as clean as you would want it to be.  The problem
is that in the case of system catalogs there's no generic class from 
which all classes inherit.  If you have designed your database such that
there *is* such a super-class then you can find tuples in your subclasses
using the * operator in the from clause:

	retrieve (g.all) from g in generic*
	where g.oid = "xxxxxx"::oid

Otherwise each inheritance heirarchy (or each class) must be queried
individually.

This also has the drawback that you only get the attributes common to all
class in the heirarchy.  If you want the attributes specific to the
class of which the tuple is an instance, you have to query that class
specifically.  Which in this case, where we have only the oid, means
that we have to query each class in the database individually.

Jeff Meredith
[email-masked]