Bug with cursor declaration in PL/pgSQL in CVS tip?

From: "Michael Paesold" <michael(at)paesold(dot)at>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Bug with cursor declaration in PL/pgSQL in CVS tip?
Date: 2005-09-13 13:41:22
Message-ID: 019e01c5b868$d4629ff0$0f01a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have used to declare cursors in the DECLARE section of a PL/pgSQL
function. The example here seems to be broken in CVS tip:

CREATE FUNCTION test () RETURNS void AS '
DECLARE
credit_cursor CURSOR (p_account integer, p_reference integer) FOR
SELECT * FROM booking
WHERE account_id=p_account AND reference=p_reference
AND unassigned_amount = amount AND amount > 0 AND side=''credit''
AND position_closed AND type NOT IN (''RC'', ''RP'')
ORDER BY journal_id ASC;
BEGIN
END
'
LANGUAGE PLPGSQL;

I get:
ERROR: syntax error at or near "," at character 237
LINE 9: credit_cursor CURSOR (p_account integer, p_reference integ...

The same function works perfectly well in 7.4.8 and 8.0.3.
A bug?

Best Regards,
Michael Paesold

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-09-13 13:47:46 Re: Spinlocks, yet again: analysis and proposed patches
Previous Message Brusser, Michael 2005-09-13 12:49:23 Re: Hard drive failure leads to corrupt db