Return-Path: owner-postman 
Delivery-Date: Wed, 11 May 94 20:05:22 -0700
Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id PAA25164 for postgres-redist; Wed, 11 May 1994 15:59:57 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199405112259.PAA25164@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from kaukau.comp.vuw.ac.nz (kaukau.comp.vuw.ac.nz [130.195.5.20]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id PAA25154 for <postgres@nobozo.CS.Berkeley.EDU>; Wed, 11 May 1994 15:59:52 -0700
Received: from downstage.comp.vuw.ac.nz (downstage.comp.vuw.ac.nz [130.195.6.10]) by kaukau.comp.vuw.ac.nz (8.6.8/8.6.6) with ESMTP id KAA04529 for <postgres@nobozo.CS.Berkeley.EDU>; Thu, 12 May 1994 10:59:29 +1200
From: Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ>
Received: from localhost (aaron@localhost) by downstage.comp.vuw.ac.nz (8.6.8/8.6.6) with SMTP id KAA04148 for <postgres@nobozo.CS.Berkeley.EDU>; Thu, 12 May 1994 10:59:44 +1200
Message-Id: <199405112259.KAA04148@downstage.comp.vuw.ac.nz>
To: postgres@postgres.Berkeley.EDU
Subject: Discovering the class from an object identifier
Date: Thu, 12 May 1994 10:59:43 +1200
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Wed, 11 May 94 15:59:57 -0700
Resent-XMts: smtp

I'm not sure how to approach this problem, maybe I'm hoping for too
much.

Given the oid of an instance, how can I discover the most specific
class the instance belongs to? 

Alternatively, how can I retrieve an instance identified by an oid,
which knowing the classes it belongs to?

Consider this toy example...

* create EMP (name = text, salary = int4,
            age = int4, dept = char16)
\g

Query sent to backend is "create EMP (name = text, salary = int4,             age = int4, dept = char16) "
CREATE
Go 
* append EMP (name = "Claire", salary = 2000,
              age = 40, dept = "shoe")
\g

Query sent to backend is "append EMP (name = "Claire", salary = 2000,               age = 40, dept = "shoe") "
APPEND 656830
Go 
* create STUD_EMP (location = point) inherits (EMP)
\g

Query sent to backend is "create STUD_EMP (location = point) inherits (EMP) "
CREATE
Go 
* append STUD_EMP (name = "Sunita", salary = 4000,
                   age = 23, dept = "electronics",
                   location = "(3, 5)")
\g

Query sent to backend is "append STUD_EMP (name = "Sunita", salary = 4000,                    age = 23, dept = "electronics",                    location = "(3, 5)") "
APPEND 656908
Go 

So given "656908"::oid how can I detemine whether it identifies a
STUD_EMP or just an EMP?

I've obviously trying to avoid querying every class in hope.

Aaron.

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================

