Re: v 2.3 warning messages

Gerhard Haering <[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Organization People's Front of Judea
Message-ID <[email protected]>
* Michael Engelhart <[email protected]> [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

[1] ... if under psql you use the same SQL that pyPgSQL sends over the wire.
-- 
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:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.