Search Postgresql Archives

tablename.columnname notation for columnnames of joined tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux