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