From: Billy G. A. <bg...@mu...> - 2002-12-23 05:29:33
|
Gerhard Haering wrote: > * Michael Engelhart <men...@ma...> [2002-12-22 17:48 -0500]: > > Hi - > > i'm running pyPgSQL 2.3 on Mac OS X 10.2.2, PostgreSQL 7.3, and Python > > 2.2 > > > > When doing any SELECT, UPDATE, INSERT or DELETE operations on the > > database I get the following database warning errors: > > > > WARNING: PerformPortalClose: portal "pgsql_0061be10" not found > > WARNING: Closing pre-existing portal "PgSQL_0061BE10" > > WARNING: PerformPortalClose: portal "pgsql_0061be10" not found > > WARNING: PerformPortalClose: portal "pgsql_006e0460" not found > > > > These do not occur when I access the database using the psql CLI > > application. > > They do [1] ;-) > > > Everything appears to work as it should even with these warnings but > > they certainly are preventing me from releasing a production system > > until I can figure out what is causing this. > > > > I have already posted this to postgresql-general but Bruce Mojiam > > seemed to think it was related to the Python interface since he was > > unable to make it occur with any of the other Python interfaces. > > I already answered there. > > > Any ideas? > > Yes, con.conn.toggleShowQuery does the trick, again: > > #v+ > gerhard@gargamel:~$ python > Python 2.2.2 (#1, Nov 30 2002, 23:19:58) > [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 > Type "help", "copyright", "credits" or "license" for more information. > >>> from pyPgSQL import PgSQL > >>> con = PgSQL.connect() > >>> con.conn.toggleShowQuery > 'On' > >>> cursor = con.cursor() > QUERY: BEGIN WORK > >>> cursor.execute("select * from test") > QUERY: DECLARE "PgSQL_0811F1EC" CURSOR FOR select * from test > QUERY: FETCH 1 FROM "PgSQL_0811F1EC" > QUERY: SELECT typname, -1 , typelem FROM pg_type WHERE oid = 23 > QUERY: SELECT typname, -1 , typelem FROM pg_type WHERE oid = 1043 > >>> result = cursor.fetchmany(5) > QUERY: FETCH 4 FROM "PgSQL_0811F1EC" > >>> result > [[None, 'A'], [None, 'B'], [None, 'C'], [None, 'F'], [None, 'F']] > >>> con.commit() > QUERY: CLOSE PgSQL_0811F1EC > QUERY: COMMIT WORK > >>> > #v- > > This gives me a warning like this: > > #v+ > WARNING: PerformPortalClose: portal "pgsql_0811f1ec" not found > #v- > > The SQL pyPgSQL emits looks perfectly valid to me. So I'm inclined to think > that the PostgreSQL warning is superfluous, at best. > > Gerhard The close of the cursor isn't quoted, so PostgreSQL converts it to lower case. This causes the problem. I will generate a patch for this tomorrow. Later. -- ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |