table.column in cursor.description?

Andrew Klaassen <clawsoon-/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Hi,

Is it possible to get psycopg2 to return full column names (i.e. "table.column" instead of just "column") in cursor.description?  This would be handy when executing joins.

I.e.

>>> cursor.execute("select * from document, element")
>>> print cursor.description
[('document.id', ...), ('document.name', ...), ('element.id', ...), ('element.text', ...)]

...instead of the current behaviour, which is:

>>> print cursor.description
[('id', ...), ('name', ...), ('id', ...), ('text', ...)]

The SQLite Python module has something like this with "pragma
full_column_names=ON;":

http://mail.python.org/pipermail/python-bugs-list/2009-January/069202.html

Possible?

Thanks.

Andrew




      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.