Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1CED4477393 for ; Tue, 7 Jan 2003 18:29:37 -0500 (EST) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by postgresql.org (Postfix) with ESMTP id 7F934476A3C for ; Tue, 7 Jan 2003 18:29:18 -0500 (EST) Received: from fwd07.sul.t-online.de by mailout07.sul.t-online.com with smtp id 18W39f-0002X6-02; Wed, 08 Jan 2003 00:29:07 +0100 Received: from gargamel.ghaering.test (510095183908-0001@[217.228.218.131]) by fmrl07.sul.t-online.com with esmtp id 18W39T-02FxtQC; Wed, 8 Jan 2003 00:28:55 +0100 Received: from lilith.ghaering.test (lilith.ghaering.test [192.168.2.10]) by gargamel.ghaering.test (Postfix) with ESMTP id DDC74378; Wed, 8 Jan 2003 00:26:13 +0100 (CET) Received: by lilith.ghaering.test (Postfix, from userid 1000) id 805F21BCA49; Wed, 8 Jan 2003 00:28:53 +0100 (CET) Date: Wed, 8 Jan 2003 00:28:53 +0100 From: Gerhard =?iso-8859-1?Q?H=E4ring?= To: Bruce Momjian Cc: Gaetano Mendola , PostgreSQL-interfaces , darcy@druid.net Subject: Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm Message-ID: <20030107232853.GB512@lilith.ghaering.test> References: <200301072213.h07MD0320646@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301072213.h07MD0320646@candle.pha.pa.us> User-Agent: Mutt/1.4i Organization: People's Front of Judea X-Sender: 510095183908-0001@t-dialin.net X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/29 X-Sequence-Number: 3529 * Bruce Momjian [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/