Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm - Mailing list pgsql-interfaces

From Gerhard Häring
Subject Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
Date
Msg-id 20030107232853.GB512@lilith.ghaering.test
Whole thread Raw
In response to Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
List pgsql-interfaces
* Bruce Momjian <pgman@candle.pha.pa.us> [2003-01-07 17:13 -0500]:
> CC'ing D'Arcy.
> 
> Sorry, we really can't backpatch that unless D'Arcy does it.  He
> controls the python interface and applied the patch only to CVS head.
> 
> ---------------------------------------------------------------------------
> 
> Gaetano Mendola wrote:
> > I already post the fact that the file pgdb.py distribuited with
> > Postgres 7.3 is wrong but was not already fixed in 7.3.1 !!!!
> > 
> > The class pgdbTypeCache is not working with the version 7.3.1
> > the method getdescr  try to do the following select:
> > 
> > "SELECT typname, typprtlen, typlen FROM pg_type"
> > 
> > and the column typprtlen is not anymore available,
> > I suggested to rewrite that select in this way:
> > 
> > "SELECT typname, 4, typlen FROM pg_type"
> > 
> > and someone else suggested:
> > 
> > "SELECT typname, -1, typlen FROM pg_type"

That was me.

This, however is WRONG, (and I'll also have to fix it in pyPgSQL
eventually).

I recently asked a related question in the Python DB-SIGs mailing list
recently in a thread
   "cursor.description - values for 'I don't know'"

asking which value to use for unknown values in cursor.description
(here: the displaysize field).

The answer is to use None for unknown values, *not* -1 like I proposed
above. In fact, the DB-API 2.0 specification clearly says so, but it
somehow slipped my eye.

Gerhard
-- 
Favourite database:             http://www.postgresql.org/
Favourite programming language: http://www.python.org/
Combine the two:                http://pypgsql.sf.net/
Embedded database for Python:   http://pysqlite.sf.net/


pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm