Re: [INTERFACES] Tables names from query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: philip(dot)shiels(at)jrc(dot)it
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Tables names from query
Date: 1999-02-22 15:49:33
Message-ID: 8738.919698573@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Philip Shiels <philip(dot)shiels(at)jrc(dot)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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ken J. Wright 1999-02-22 18:31:29 RE: [INTERFACES] pgAdmin 6.4.3 Released
Previous Message Bob VonMoss 1999-02-22 15:47:33 Re: [INTERFACES] Tables names from query