Tables names from query - Mailing list pgsql-hackers

From Philip Shiels
Subject Tables names from query
Date
Msg-id 36D1334B.D61D9B3A@jrc.it
Whole thread Raw
List pgsql-hackers
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.Shiels@jrc.it      JRC Ispra, Italy, TP270
GIST:http://gist.jrc.it CEO:http://www.ceo.org GEM:http://gem.jrc.it

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] large objects failing (hpux10.20 sparc/solaris 2.6, gcc 2.8.1)
Next
From: Mohamed Hefny
Date:
Subject: Playing with postgres