[DB-SIG] [ANN] pyPgSQL 2.1 released

Andy Dustman andy@dustman.net
06 Jun 2002 13:54:20 -0400

On Thu, 2002-06-06 at 12:29, Gerhard H=E4ring wrote:
> * Federico Di Gregorio <fog@initd.org> [2002-06-06 18:18 +0200]:
> > erm. psycopg has dictfetchXXX methods. but i think is much better
> > implement them in python-space, if you really use them a lot. (for
> > example, if you have two columns with the same name, psycopg will
> > happily overwrite the first one with the second.)
> Probably best to raise
>     ProgrammingError("don't use SELECT * damnit, and go look about\
>         AS in your SQL book")

MySQLdb does this with a separate cursor class (DictCursor), and when it
finds a conflicting name, it prepends the table name to the key, i.e.
table.column. Of course, I agree completely with the comment about

Andy Dustman         PGP: 0x930B8AB6
    @       .net     http://dustman.net/andy
"Cogito, ergo sum." -- Rene Descartes
"I yam what I yam and that's all that I yam." -- Popeye