Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA28467; Tue, 3 Mar 92 11:46:34 -0800
Message-Id: <9203031946.AA28467@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: oid
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Wed, 26 Feb 92 11:16:10 PST."
             <9202261916.AA12511@postgres.Berkeley.EDU> 
Date: Tue, 03 Mar 92 11:45:58 PST

you write:
> 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?

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
mer@postgres.berkeley.edu
