agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
Discovering the class from an object identifier
2+ messages / 2 participants
[nested] [flat]

* Discovering the class from an object identifier
@ 1994-05-11 22:59  Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ>
  0 siblings, 1 reply; 2+ messages in thread

From: Aaron Roydhouse @ 1994-05-11 22:59 UTC (permalink / raw)
  To: legacy

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.
===============================================================================




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Discovering the class from an object identifier
@ 1994-05-12 02:16  Paul M. Aoki <aoki@postgres.Berkeley.EDU>
  parent: Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ>
  0 siblings, 0 replies; 2+ messages in thread

From: Paul M. Aoki @ 1994-05-12 02:16 UTC (permalink / raw)
  To: Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ>; +Cc: legacy

Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ> writes:
> 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?
> I've obviously trying to avoid querying every class in hope.

the commercial derivative of postgres splits oids into a class
identifier and an instance identifier, but postgres itself just
assigned oids sequentially in a given database.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki

===============================================================================
    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.
===============================================================================




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1994-05-12 02:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1994-05-11 22:59 Discovering the class from an object identifier Aaron Roydhouse <Aaron.Roydhouse@Comp.VUW.AC.NZ>
1994-05-12 02:16 ` Paul M. Aoki <aoki@postgres.Berkeley.EDU>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox