tablename.columnname notation for columnnames of joined tables - Mailing list pgsql-general

From dgroth@gmx.de
Subject tablename.columnname notation for columnnames of joined tables
Date
Msg-id 1131114564.027506.88430@g47g2000cwa.googlegroups.com
Whole thread Raw
List pgsql-general
Hello,

I know it is possible in other dbs like sqlite.

Let's say I have two tables which I want to join owners (name,age) and
dogs (name,owner,age).

select * from owners as a join dogs as b on a.name = b.owner

How could I convince postgres to prefix the returned  columnnames with
the tablename like owners.name, dogs.name etc.

I need this for a python and tcl interface and if only name is
retrieved as columnname, then the last value is assigned to the
hash/dictionary entry "age". So the owner gets the age of his dog :(
and even its name :(( . Hoe you get the point

I know that I can use fully qualified columnames instead of "select *"
but this is very annoying if you have many columns and you nest your
statements.

Is there a solution ?

regards, Detlef


pgsql-general by date:

Previous
From: "Lolke B. Dijkstra"
Date:
Subject: BLOB and OID
Next
From: Bob
Date:
Subject: Re: Oracle 10g Express - any danger for Postgres?