pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: philip.shiels@jrc.it
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Tables names from query
Date: Mon, 22 Feb 1999 10:49:33 -0500
Message-ID: <8738.919698573@sss.pgh.pa.us> (raw)
In-Reply-To: <36D15B0D.B57DB69C@jrc.it>

Philip Shiels <philip.shiels@jrc.it> writes:
> I'm currently developing a postgres DB backend to my current project and have
> the following problem. If I execute a query I need to know the table the
> returning fields belong to. For example :

> SELECT x.y, z.y from x, y where x.key = z.key

Can you use "SELECT AS"?  For instance

	SELECT x.y AS x_y, z.y AS z_y WHERE ...

A bit grotty, but there's no hope of changing the column-labeling
behavior without modifying the innards of the backend; the column names
you see in psql are all the info there is on the client side.

I dunno whether it would be a good idea to change the backend's column
labeling rules for this case or not.  I'd be worried about breaking
existing applications that depend on the current labeling rules...

			regards, tom lane



view thread (6+ messages)

Message-ID: <8738.919698573@sss.pgh.pa.us>
Permalink:  ../8738.919698573@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8738.919698573@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, philip.shiels@jrc.it
  Subject: Re: [INTERFACES] Tables names from query
  In-Reply-To: <8738.919698573@sss.pgh.pa.us>

* 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