Bug 142711

Summary: [python] Recent update breaks the pgdb module
Product: [Fedora] Fedora Reporter: Enrico Scholz <rh-bugzilla>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: hhorak, jjneely, skathalkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-17 16:42:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2004-12-13 09:03:09 UTC
Description of problem:

After upgrade to postgresql-7.4.6-1.FC2.1 the pgdb module stops to
work:

| import pgdb
| db = pgdb.connect(host='db', database='mailstat')
| c  = db.cursor()
| c.execute("SELECT %u", (1,))


| Traceback (most recent call last):
|   File "<stdin>", line 4, in ?
|   File "/tmp/pgdb.py", line 188, in execute
|     self.executemany(operation, (params,))
|   File "/tmp/pgdb.py", line 209, in executemany
|     raise OperationalError, "internal error in '%s' (%s)" % (sql,e)
| pgdb.OperationalError: internal error in 'INIT'


This is caused by syntax like

|          elif type(x, (types.IntType, types.LongType, types.FloatType)):
...
|          elif type(x, (types.ListType, types.TupleType)):

which is not valid python code.


Version-Release number of selected component (if applicable):

postgresql-7.4.6-1.FC2.1


How reproducible:

100%



Additional info:

Marking this as HIGH priority as it breaks all python programs based
on pgdb which worked before the upgrade.

Comment 1 Tom Lane 2004-12-13 18:25:01 UTC
Thanks for the report.  I checked with PyGreSQL's author, who replies:

<quote>
This bug was fixed days later but I never made a new version.  I now
use isinstance() anyway which is the more correct method.

I will get 3.6 out right away with this and other fixes.
</quote>

I'll roll out a new Fedora release as soon as I get 3.6 from him.

Comment 5 Tom Lane 2004-12-17 16:42:53 UTC
Fixed (I trust) in this morning's release.

Comment 6 Tom Lane 2004-12-18 20:24:59 UTC
*** Bug 143281 has been marked as a duplicate of this bug. ***

Comment 7 Tom Lane 2005-03-29 06:53:02 UTC
*** Bug 152392 has been marked as a duplicate of this bug. ***