Received: from fepa.mail.ozemail.net (fepa.mail.ozemail.net [203.2.192.101]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA71003 for ; Thu, 22 Jul 1999 00:42:47 -0400 (EDT) (envelope-from chris@tech.com.au) Received: from tech.com.au (h208.ozemail2.ozemail.com.au [203.108.14.208]) by fepa.mail.ozemail.net (8.9.0/8.6.12) with ESMTP id OAA11506; Thu, 22 Jul 1999 14:41:26 +1000 (EST) Message-ID: <3793E1D5.38A08771@tech.com.au> Date: Tue, 20 Jul 1999 12:41:25 +1000 From: Chris Bitmead X-Mailer: Mozilla 4.6 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Don Yury CC: pgsql-sql@hub.org Subject: Re: [SQL] how to determine table? References: <37969C56.ADFC172B@vpcit.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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