Open hawicz opened 4 years ago
Thanks for reporting this. I wonder if the repeated DECLARE
is causing the issue here. Can you try rewriting your example like so?
create or replace function foo()
returns void
language plpgsql
as $$
DECLARE
mycur CURSOR FOR SELECT * from pg_database;
BEGIN
return;
END;
$$;
If that doesn't work, it looks fixable with minor changes to the grammar specification. If you'd like to take a stab at it, I'll be happy to review and merge a PR. Otherwise, I will get to it but will probably take a week or two.
Looks fairly simple to tweak, I'll take a look.
A function that looks like this:
Results in:
On the other hand, changing it to say "... SELECT 1..." instead of "...SELECT *..." works (though of course it's not very useful to have a query that does effectively nothing).