pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Bitmead <chris@tech.com.au>
To: Don Yury <yura@vpcit.ru>
Cc: pgsql-sql@hub.org
Subject: Re: [SQL] how to determine table?
Date: Tue, 20 Jul 1999 12:41:25 +1000
Message-ID: <3793E1D5.38A08771@tech.com.au> (raw)
References: <37969C56.ADFC172B@vpcit.ru>

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



view thread (2+ messages)  latest in thread

Message-ID: <3793E1D5.38A08771@tech.com.au>
Permalink:  ../3793E1D5.38A08771@tech.com.au/
Also on:    postgresql.org/message-id/3793E1D5.38A08771@tech.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: chris@tech.com.au, yura@vpcit.ru, pgsql-sql@hub.org
  Subject: Re: [SQL] how to determine table?
  In-Reply-To: <3793E1D5.38A08771@tech.com.au>
  References: <37969C56.ADFC172B@vpcit.ru> <3793E1D5.38A08771@tech.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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