From: Gerhard Häring <haering_postgresql@gmx.de>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Gaetano Mendola <mendola@bigfoot.com>
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Cc: darcy@druid.net
Subject: Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
Date: Wed, 8 Jan 2003 00:28:53 +0100
Message-ID: <20030107232853.GB512@lilith.ghaering.test> (raw)
In-Reply-To: <200301072213.h07MD0320646@candle.pha.pa.us>
References: <auersq$1jup$1@news.hub.org>
<200301072213.h07MD0320646@candle.pha.pa.us>
* 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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: haering_postgresql@gmx.de, pgman@candle.pha.pa.us, mendola@bigfoot.com, darcy@druid.net
Subject: Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
In-Reply-To: <20030107232853.GB512@lilith.ghaering.test>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox