Skip site navigation (1) Skip section navigation (2)

Tables names from query

From: Philip Shiels <philip(dot)shiels(at)jrc(dot)it>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Tables names from query
Date: 1999-02-22 13:26:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 (Icannot assume anything about
the query except that it's a SELECT).

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

Is there is a way of identifying the originating tables ?

Philip Shiels     E-Mail:Philip(dot)Shiels(at)jrc(dot)it      JRC Ispra, Italy, TP270


pgsql-interfaces by date

Next:From: The Hermit HackerDate: 1999-02-22 14:19:59
Subject: Re: [INTERFACES] Crystal Report ...
Previous:From: Anatoly K. LasareffDate: 1999-02-22 11:53:04
Subject: Re: [INTERFACES] Tables names from query

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group