pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: [SQL] how to determine table?
2+ messages / 2 participants
[nested] [flat]
* Re: [SQL] how to determine table?
@ 1999-07-20 02:41 Chris Bitmead <chris@tech.com.au>
parent: Don Yury <yura@vpcit.ru>
0 siblings, 0 replies; 2+ messages in thread
From: Chris Bitmead @ 1999-07-20 02:41 UTC (permalink / raw)
To: Don Yury <yura@vpcit.ru>; +Cc: pgsql-sql@hub.org
Good question. This is something I desperately want also. I proposed
that there be an imaginary field on all tables called "classoid" for the
oid of the class it belongs to (allowing a join with pg_class) or
perhaps a "relname" imaginary field giving the name of the relation.
Unfortunately it doesn't exist now, and having a real field with the
table name is the best that can be done.
Don Yury wrote:
>
> Hi All.
>
> Suppose I do select from class with all subclasses, for example
>
> SELECT id, name FROM TAB*
>
> and I get something like
>
> id | name
> ---------
> 1 | n1
> 2 | n2
> 3 | n3
> ...
>
> Then I want to know about certain record name of table where this record
> is stored, for example I want to know in which table record (2, n2). How
> I can do this?
> I guess I can add field 'tablename' to every subclass of tab class and
> fill it with certain table name in trigger, but perhaps exists more easy
> way?
>
> Sincerely yours, Yury.
> don.web-page.net, ICQ 11831432
^ permalink raw reply [nested|flat] 2+ messages in thread
* how to determine table?
@ 1999-07-22 04:21 Don Yury <yura@vpcit.ru>
0 siblings, 1 reply; 2+ messages in thread
From: Don Yury @ 1999-07-22 04:21 UTC (permalink / raw)
To: pgsql-sql@hub.org
Hi All.
Suppose I do select from class with all subclasses, for example
SELECT id, name FROM TAB*
and I get something like
id | name
---------
1 | n1
2 | n2
3 | n3
...
Then I want to know about certain record name of table where this record
is stored, for example I want to know in which table record (2, n2). How
I can do this?
I guess I can add field 'tablename' to every subclass of tab class and
fill it with certain table name in trigger, but perhaps exists more easy
way?
Sincerely yours, Yury.
don.web-page.net, ICQ 11831432
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-07-22 04:21 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-22 04:21 how to determine table? Don Yury <yura@vpcit.ru>
1999-07-20 02:41 ` Chris Bitmead <chris@tech.com.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox