pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedPerformPortalClose warning in 7.3
4+ messages / 4 participants
[nested] [flat]
* PerformPortalClose warning in 7.3
@ 2002-12-12 22:50 Michael Engelhart <mengelhart@mac.com>
0 siblings, 2 replies; 4+ messages in thread
From: Michael Engelhart @ 2002-12-12 22:50 UTC (permalink / raw)
To: pgsql-general@postgresql.org
Hi -
I've been running PostgreSQL 7.3 on Mac OS X 10.2 since it was released
and it's been running fine. I'm using pyPgSQL 2.3 for client side
programming which also was working great until tonight. Now whenever
I do any query of any type, I get warnings like this:
WARNING: PerformPortalClose: portal "pgsql_00179f10" not found
It "appears" that everything is still working the way it was but it's a
bit discomforting to have these show up on my screen while running my
applications.
Anyone that can explain this?
Here's a tiny bit of Python sample code that I used to make sure it
wasn't my other code causing the problems
from pyPgSQL import PgSQL
dbname = "template1"
conn = PgSQL.connect(database=dbname)
cursor = conn.cursor()
sql = "SELECT now()";
cursor.execute(sql)
res = cursor.fetchall()
for i in res:
print i
cursor.close()
conn.commit()
strangely if I remove the last 2 lines (cursor.close() and
conn.commit()) I don't get the errors.
Also I don't notice that I don't have this problem with psql command
line either. Is this the Python API causing this?
Thanks for any help
Mike
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [GENERAL] PerformPortalClose warning in 7.3
@ 2002-12-14 22:58 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Michael Engelhart <mengelhart@mac.com>
1 sibling, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2002-12-14 22:58 UTC (permalink / raw)
To: Michael Engelhart <mengelhart@mac.com>; +Cc: pgsql-interfaces
I tried to reproduce the problem here but it seems my python is too old.
I am CC'ing this to the interfaces list in case someone there knows or
can test it.
---------------------------------------------------------------------------
Michael Engelhart wrote:
> Hi -
> I've been running PostgreSQL 7.3 on Mac OS X 10.2 since it was released
> and it's been running fine. I'm using pyPgSQL 2.3 for client side
> programming which also was working great until tonight. Now whenever
> I do any query of any type, I get warnings like this:
>
> WARNING: PerformPortalClose: portal "pgsql_00179f10" not found
>
> It "appears" that everything is still working the way it was but it's a
> bit discomforting to have these show up on my screen while running my
> applications.
>
> Anyone that can explain this?
>
> Here's a tiny bit of Python sample code that I used to make sure it
> wasn't my other code causing the problems
>
> from pyPgSQL import PgSQL
>
> dbname = "template1"
> conn = PgSQL.connect(database=dbname)
> cursor = conn.cursor()
> sql = "SELECT now()";
> cursor.execute(sql)
> res = cursor.fetchall()
> for i in res:
> print i
> cursor.close()
> conn.commit()
>
> strangely if I remove the last 2 lines (cursor.close() and
> conn.commit()) I don't get the errors.
>
> Also I don't notice that I don't have this problem with psql command
> line either. Is this the Python API causing this?
>
> Thanks for any help
>
> Mike
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PerformPortalClose warning in 7.3
@ 2002-12-23 01:18 Gerhard Haering <haering_postgresql@gmx.de>
parent: Michael Engelhart <mengelhart@mac.com>
1 sibling, 1 reply; 4+ messages in thread
From: Gerhard Haering @ 2002-12-23 01:18 UTC (permalink / raw)
To: pgsql-general@postgresql.org
Michael Engelhart wrote in gmane.comp.db.postgresql.general:
> Hi -
> I've been running PostgreSQL 7.3 on Mac OS X 10.2 since it was released
> and it's been running fine. I'm using pyPgSQL 2.3 for client side
> programming which also was working great until tonight. Now whenever
> I do any query of any type, I get warnings like this:
>
> WARNING: PerformPortalClose: portal "pgsql_00179f10" not found
>
> It "appears" that everything is still working the way it was but it's a
> bit discomforting to have these show up on my screen while running my
> applications.
>
> Anyone that can explain this?
>
> Here's a tiny bit of Python sample code that I used to make sure it
> wasn't my other code causing the problems
>
> from pyPgSQL import PgSQL
>
> dbname = "template1"
> conn = PgSQL.connect(database=dbname)
> cursor = conn.cursor()
> sql = "SELECT now()";
> cursor.execute(sql)
> res = cursor.fetchall()
> for i in res:
> print i
> cursor.close()
> conn.commit()
Actually, pyPgSQL is using PostgreSQL portals behind your back. This
is a feature!
To show this, we use the undocumented, but very handy toggleShowQuery
flag. The effect is that we can see what SQL pyPgSQL sends to the
backend using libpq (the lines staring with QUERY: below):
#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-
As far as I can see, the SQL pyPgSQL emits is perfectly ok. But I'd be
glad to hear a clarification.
> strangely if I remove the last 2 lines (cursor.close() and
> conn.commit()) I don't get the errors.
>
> Also I don't notice that I don't have this problem with psql command
> line either. Is this the Python API causing this?
If you use the same SQL statements using portals in psql, you get the
same warning (obviously). I just tried.
Gerhard (pyPgSQL developer)
--
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/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: PerformPortalClose warning in 7.3
@ 2002-12-23 02:36 Tom Lane <tgl@sss.pgh.pa.us>
parent: Gerhard Haering <haering_postgresql@gmx.de>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2002-12-23 02:36 UTC (permalink / raw)
To: Gerhard Haering <haering_postgresql@gmx.de>; +Cc: pgsql-general@postgresql.org
Gerhard Haering <haering_postgresql@gmx.de> writes:
> To show this, we use the undocumented, but very handy toggleShowQuery
> flag. The effect is that we can see what SQL pyPgSQL sends to the
> backend using libpq (the lines staring with QUERY: below):
> QUERY: DECLARE "PgSQL_0811F1EC" CURSOR FOR select * from test
> ...
> QUERY: CLOSE PgSQL_0811F1EC
This looks like a pyPgSQL bug to me. If it's going to use a mixed-case
name for the cursor then it must either always double-quote the name or
never do so. Failing to double-quote in the CLOSE command is wrong.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2002-12-23 02:36 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-12 22:50 PerformPortalClose warning in 7.3 Michael Engelhart <mengelhart@mac.com>
2002-12-14 22:58 ` Bruce Momjian <pgman@candle.pha.pa.us>
2002-12-23 01:18 ` Gerhard Haering <haering_postgresql@gmx.de>
2002-12-23 02:36 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox