Re: typprtlen

Gerhard Häring <[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Organization People's Front of Judea
Message-ID <[email protected]>
* Oliver Vecernik <[email protected]> [2003-01-09 09:43 +0100]:
> Hi!
> 
> I tried to use PgSQL on Debian/Woody and received following error:
> 
> Python 2.1.3 (#1, Sep  7 2002, 15:29:56)
> [GCC 2.95.4 20011002 (Debian prerelease)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> from pyPgSQL import PgSQL
> >>> cx = PgSQL.connect('p200::test')
> >>> cu = cx.cursor()
> >>> cu.execute("select * from t1")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.1/site-packages/pyPgSQL/PgSQL.py", line 2157, 
> in execute
>     self.__makedesc__()
>   File "/usr/lib/python2.1/site-packages/pyPgSQL/PgSQL.py", line 1892, 
> in __makedesc__
>     _tn, _pl, _ia, _bt = _cache.getTypeInfo(_typ)
>   File "/usr/lib/python2.1/site-packages/pyPgSQL/PgSQL.py", line 576, 
> in getTypeInfo
>     _res = self.__conn.conn.query("SELECT typname, typprtlen, typelem "
> libpq.OperationalError: ERROR:  Attribute "typprtlen" not found
> 
> >>>
> 
> 
> ii  python-pgsql   2.0-3.1        A Python DB-API 2.0 interface to 
> PostgreSQL
> 
> Am I doing something wrong, or is this a broken package in Debian?

You're using pyPgSQL against a PostgreSQL 7.3.x database. pyPgSQL,
however, supports a Pg 7.3 backend only in the latest released version
(pyPgSQL 2.3).

So, for the moment you need to compile pyPgSQL yourself, as even the
Debian unstable package seems to still be a 2.3-beta1.

If you want to do a quick hack in your pyPgSQL 2.0 package instead, you
can try to change the typprtlen field in the select to NULL.

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/


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.