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
> Sincerely yours, Yury.
> don.web-page.net, ICQ 11831432
In response to
pgsql-sql by date
|Next:||From: Vikrant Rathore||Date: 1999-07-20 04:30:28|
|Previous:||From: Dionisio Barrantes||Date: 1999-07-19 17:16:12|
|Subject: RE: pgsql-sql-digest V1 #281|