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

From Manuel Tejada
Subject PostgreSQL 7.4.1 and pgdb.py
Date
Msg-id 000a01c3e79f$c7e2ed20$4bd73cc8@leon
Whole thread Raw
Responses Re: PostgreSQL 7.4.1 and pgdb.py
Re: PostgreSQL 7.4.1 and pgdb.py
Re: PostgreSQL 7.4.1 and pgdb.py
List pgsql-general
Hi
My box: RedHat 9.0, Pentium III

Recently I upgraded from PostgreSQL 7.3.2 to PostgreSQL 7.4.1.
The PostgreSQL 7.3.2's rpms were installed from RehHat CDs
The PostgreSQL 7.4.1's rpms I used to upgrade were downloaded from RHEL3
subdirectory (of the mirror
ftp://ftp4.ar.postgresql.org/pub/mirrors/postgresql/binary/v7.4.1/redhat/rhel3).

The upgrade is working well, even I can connect to PostgreSQL from a PHP
script.

Before upgrading I used to connect to PostgresQL using pgdb.py (part of
PyGreSQL that comes with one of the rpms I guess). The sintaxis I was using
from interactive shell were:

---------------
>>>import pgdb
>>>dbConnect = pgdb.connect(dsn='localhost:oracle', user='manuel',
password='')
>>>cursor = dbConnect.cursor()
>>>cursor.execute("select * from address")
>>>while (1):
...     row = cursor.fetchone()
...     if row == None:
...        break
...     print row
...
['BAILEY','WILLIAM',None,None,None,None,'213-293-0223',None]
['ADAMS','JACK',None,None,None,None,'415-453-7330',None]
-
-
>>>cursor.close()
>>>dbConnect.close()
-----------------------

As you can see, the connection and fechting were successful.

But now when I input the same sintaxis with the new Installation(PostgreSQL
7.4.1), I get an error when I enter rhe four line:

----------------
>>>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"
------------------

By the way the types of columns from address table are:
lastname  varchar(25)
firstname varchar(25)
street      varchar(30)
city         varchar(15)
state       varchar(2)
zip         int
phone    varchar(12)
ext        varchar(5)

My questions:

-Anybody knows why I can't connect to PostgreSQL using the pgdb.py module
now?
- Perhaps the sintaxis has changed?


Manuel Tejada


pgsql-general by date:

Previous
From: ljb
Date:
Subject: Re: Problem with API (libpq) - detailed error codes
Next
From: "Lee Harr"
Date:
Subject: Re: Are there commands to enquire about table structure?