Re: PostgreSQL 7.4.1 and pgdb.py - Mailing list pgsql-general

From Manuel Tejada
Subject Re: PostgreSQL 7.4.1 and pgdb.py
Date
Msg-id 001c01c3e92b$4c03f860$a4e430c8@alejo
Whole thread Raw
In response to PostgreSQL 7.4.1 and pgdb.py  ("Manuel Tejada" <mantemu@terra.com.pe>)
Responses Re: PostgreSQL 7.4.1 and pgdb.py  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-general
Thank you very much Gaetano

I edited the pgdb.py file setting "4" instead of "typprtlen".
Now I am able to connect to PostgreSQL using pgdb.py.

Just for curiosity,  Can I set to -1 too as Gerhard Haring told to you?


----- Original Message -----
From: "Gaetano Mendola" <mendola@bigfoot.com>
Newsgroups: comp.databases.postgresql.general
Cc: "Manuel Tejada" <mantemu@terra.com.pe>
Sent: Sunday, February 01, 2004 4:48 PM
Subject: Re: PostgreSQL 7.4.1 and pgdb.py


> Manuel Tejada wrote:
> >
> >>>>import pgdb
> >>>>dbConnect = pgdb.connect(dsn='localhost:oracle', user='manuel',
> >
> > password='')
> >
> >>>>cursor = dbConnect.cursor()
> >>>>cursor.execute("select * from address")
> >
> > Traceback (most recent call last):
> >    File "<stdin>", line 1, in ?
> >    File "/usr/lib/python2.2/site-packages/pgdb.py", line 189, in execute
> > self.executemany(operation, (params,))
> >    File "/usr/lib/python2.2/site-packages/pgdb.py", line 221, in
executemany
> > desc = type[1:2]+self ._cache.getdescr(typ[2])
> >    File "/usr/lib/python2.2/site-packages/pgdb.py", line 149, in
getdescr
> > self  ._source.execute(
> > _pg.error: ERROR: non exist the column "typprtlen"
> > ------------------
>
> This is a really old problem already solved on 7.3 see this my post:
>
> http://archives.postgresql.org/pgsql-bugs/2002-12/msg00082.php
>
> I'm checking that my 7.4.1 installation is affected by the same
> problem. I don't understand how this could happen that a modification
> made on a 7.3 was not ported to 7.4
>
> For the moment what you can do is substitute this select:
>
> "SELECT typname, typprtlen, typlen "
> "FROM pg_type WHERE oid = %s" % oid
>
> inside the file pgdb.py with this one:
>
> "SELECT typname, 4, typlen "
> "FROM pg_type WHERE oid = %s" % oid
>
> just to not break all file.
>
> I'm not able to look at CVS to see where the modification was lost.
>
> Regards
> Gaetano Mendola
>
>
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Functions in CHECK constraint not getting dumped before tables.
Next
From: Gaetano Mendola
Date:
Subject: Re: PostgreSQL 7.4.1 and pgdb.py