Cursor case-sensitivity

Started by Key88 SFabout 23 years ago2 messagesbugs
Jump to latest
#1Key88 SF
key88sf@hotmail.com

Not sure if this is known or not, but apparently cursors names are not
appropriately case-lowered when dealing with functions that return cursors.

Using the example straight from the documentation at
http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html:

This works:

BEGIN;
SELECT reffunc('funccursor');
FETCH ALL IN funccursor;
COMMIT;

But this doesn't work:
BEGIN;
SELECT reffunc('funcCursor');
FETCH ALL IN funcCursor;
COMMIT;

This 2nd one gives a warning in the log of:
WARNING: PerformPortalFetch: portal "funccursor" not found.

-Dave

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Key88 SF (#1)
Re: Cursor case-sensitivity

"Key88 SF" <key88sf@hotmail.com> writes:

BEGIN;
SELECT reffunc('funcCursor');
FETCH ALL IN funcCursor;
COMMIT;
WARNING: PerformPortalFetch: portal "funccursor" not found.

I don't think this is a bug. You should have written

FETCH ALL IN "funcCursor";

regards, tom lane