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

Bug #879: python interface broken by removal of pg_type.typprtlen

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #879: python interface broken by removal of pg_type.typprtlen
Date: 2003-01-21 15:30:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Peter Harris (peter(dot)harris(at)kyndal(dot)co(dot)uk) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
python interface broken by removal of pg_type.typprtlen

Long Description
Version 7.3.1,  pg_type seems to no longer have a column called typprtlen.  This is OK by me, as that column is considered 'unused'.

src/interfaces/python/ expects it to be there, (line 150):
                "SELECT typname, typprtlen, typlen "
                "FROM pg_type WHERE oid = %s" % oid

ALL queries through fail with a traceback:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/free/lib/python2.2/site-packages/", line 189, in execute
    self.executemany(operation, (params,))
  File "/free/lib/python2.2/site-packages/", line 221, in executemany
    desc = typ[1:2]+self.__cache.getdescr(typ[2])
  File "/free/lib/python2.2/site-packages/", line 149, in getdescr
_pg.error: ERROR:  Attribute "typprtlen" not found

The field is returned as part of the return value of the cursor.description() method for Python's DB API v2.0, but I
don't know of any requirement for what the value is.

Accordingly, I am working around this by replacing with:
                "SELECT typname, typlen as typprtlen, typlen "

Sample Code
>>> import pgdb
>>> db=pgdb.connect(host=...,database=...,user=...,password=...)
>>> cur=db.cursor()
>>> cur.execute("select * from some_table")
... dies with traceback, as described.

No file was uploaded with this report


pgsql-bugs by date

Next:From: Tom LaneDate: 2003-01-21 15:38:36
Subject: Re: Bug #879: python interface broken by removal of pg_type.typprtlen
Previous:From: AverkDate: 2003-01-21 01:08:44
Subject: stored procedure namespace bug (critical) + COALECSE notice

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