Thread

  1. postgresql-7.3rc2 python interface fails

    george young <gry@ll.mit.edu> — 2002-11-26T19:44:57Z

    [SuSE Linux 8.0, Postgresql-7.3rc2, gcc-3.2, python 2.2.1]
    [using PyGresql v3.3 from the 7.3rc2 distribution]
    
    Postgres install goes fine as a fresh install.  Psql access is fine.
    Pgdb (the python interface) cursor.execute fails on any query; it asks for "pg_type.typprtlen",
    which has apparently been deleted from postgresql 7.3:
       http://archives.postgresql.org/pgsql-hackers/2002-07/msg00577.php
    
    sty:>  python
    Python 2.2.1 (#1, Sep 25 2002, 17:25:00) 
    [GCC 3.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pgdb
    >>> db=pgdb.connect(host='localhost',database='template1')
    >>> cur=db.cursor()
    >>> cur.execute('select * from pg_class')
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/local/lib/python2.2/site-packages/pgdb.py", line 189, in execute
        self.executemany(operation, (params,))
      File "/usr/local/lib/python2.2/site-packages/pgdb.py", line 221, in executemany
        desc = typ[1:2]+self.__cache.getdescr(typ[2])
      File "/usr/local/lib/python2.2/site-packages/pgdb.py", line 149, in getdescr
        self.__source.execute(
    _pg.error: ERROR:  Attribute "typprtlen" not found
    
    From the postgres log, the offending query was:
        SELECT typname, typprtlen, typlen FROM pg_type WHERE oid = 19
    
    What was typprtlen supposed to mean? 
    
    Most of my postgres applications are written in python -- I *have* to have
    a working python interface...
    
    Problem also exists in PyGreSQL-3.4-pre020320.
    
    -- George
    
    George Young,  Rm. L-204		gry at ll.mit.edu
    MIT Lincoln Laboratory
    244 Wood St.
    Lexington, Massachusetts  02420-9108	(781) 981-2756
    
    SCSI is not magic. There are fundamental technical reasons why it
    is necessary to sacrifice a young goat to your SCSI chain now and
    then.