From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com> |
Cc: | pgsql-hackers(at)hub(dot)org |
Subject: | Re: [HACKERS] ODMG interface |
Date: | 1999-05-09 17:21:59 |
Message-ID: | 2397.926270519@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com> writes:
>> I would propose a pseudo column (or funtion) so that one could do:
>> select rowrelname() as class_name, * from person*;
>> and then work from there on.
> Basicly that's what I want to implement, except that instead of
> returning the relname() I think the rel_classoid (oid of pg_class) is a
> better choice. Then obtaining the relname a simple join with pg_class.
OK, I'm starting to get the picture, and I agree there's no way to get
the system to give you this info now. (You could store a user field
that provides the same info, of course, but that's kind of ugly.)
I think you'd have to implement it as a system attribute (like oid,
xid, etc) rather than as a function, because in a join scenario you
need to be able to indicate which tables you are talking about.
For example, to find men with wives named Sheila in your database:
select p1.classoid, p1.firstname, p1.lastname
from person* as p1, person* as p2
where p1.spouse = p2.oid and p2.firstname = 'Sheila';
If it were "select classoid(), ..." then you'd have no way to indicate
which person's classoid you wanted.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 1999-05-09 17:31:52 | Re: [HACKERS] Oops, I seem to have changed UNION's behavior |
Previous Message | Tom Lane | 1999-05-09 17:04:35 | Re: [HACKERS] Re: [ADMIN] maximum attribute record. |