Skip site navigation (1) Skip section navigation (2)

PostgreSQL 7.4.1 and pgdb.py

From: "Manuel Tejada" <mantemu(at)terra(dot)com(dot)pe>
To: <pgsql-general(at)postgresql(dot)org>
Subject: PostgreSQL 7.4.1 and pgdb.py
Date: 2004-01-31 02:13:09
Message-ID: 000a01c3e79f$c7e2ed20$4bd73cc8@leon (view raw or flat)
Thread:
Lists: 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


Responses

pgsql-general by date

Next:From: Lee HarrDate: 2004-01-31 02:22:09
Subject: Re: Are there commands to enquire about table structure?
Previous:From: listasDate: 2004-01-31 02:05:02
Subject: Re: IDENT and pg_hda.conf

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group