Tables names from query

From: Philip Shiels <philip(dot)shiels(at)jrc(dot)it>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Tables names from query
Date: 1999-02-22 10:36:59
Message-ID: 36D1334B.D61D9B3A@jrc.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

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

The problem with the above is that I get back 2 fields called 'y' and have no
way of knowing from which tables they've come from. The query is arbitrary so I
cannot assume table order in the SQL statement.

What information from the 'C' or 'C++' APIs can help ?

Is there is a way of identifying the originating tables ?

Thanks
Philip
--------------------------------------------------------------------------
Philip Shiels E-Mail:Philip(dot)Shiels(at)jrc(dot)it JRC Ispra, Italy, TP270
GIST:http://gist.jrc.it CEO:http://www.ceo.org GEM:http://gem.jrc.it

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Broytmann 1999-02-22 13:22:31 SELECT COUNT(DISTINCT)
Previous Message Jan Wieck 1999-02-22 10:01:23 Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/test/regress/expected rules.out'

Browse pgsql-interfaces by date

  From Date Subject
Next Message Dave Page 1999-02-22 10:45:44 RE: [INTERFACES] pgAdmin 6.4.3 Released
Previous Message Philip Shiels 1999-02-22 10:24:28 Tables names from query