Setof-returning function create script bug

From: Stefan Stefanov <stefanov(dot)sm(at)abv(dot)bg>
To: pgadmin-support(at)postgresql(dot)org
Subject: Setof-returning function create script bug
Date: 2015-11-26 19:18:21
Message-ID: 1175973223.4140288.1448565501797.JavaMail.apache@nm31.abv.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Dear Sir or Madam,
I am writing to report a bug in pgadmin III 1.22.0-beta1 running on Windows 7 x64 connected to PostgreSQL 9.5beta2 64 bit.
To reproduce the bug create this function using SQL query editor:

create or replace function afunc() returns setof record as
$$
begin

return next (1, 2, 3);

return next (2, 3, 4);
end;
$$ language plpgsql;

The function works fine when invoked with a query like this one

select * from afunc() as x(a integer, b integer, c integer);

However when the function is selected in Object browser this is what appears in the SQL pane:

-- Function: public.afunc()

-- DROP FUNCTION public.afunc();

CREATE OR REPLACE FUNCTION public.afunc()

RETURNS SETOF SETOF record AS
$BODY$
begin
return next (1, 2, 3);
return next (2,3,4);
end;
$BODY$

LANGUAGE plpgsql VOLATILE

COST 100

ROWS 1000;
ALTER FUNCTION public.afunc()

OWNER TO postgres;

There are two SETOF-s after the RETURNS declaration and this makes the code invalid. Rightclick-Scripts-Create script produces the same.
The bug appeared on pgadmin III 1.18 running on windows xp connected to 32-bit Postgresql 9.2 as well.
It is not really a show stopper yet annoying.

Thank you for the great job you are doing.
Sincerely,

Stefan

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Per Wigren 2015-11-26 23:01:45 Greenplum warning message
Previous Message Michal Kozusznik 2015-11-23 13:35:03 Re: Re: PG admin 111 v 1.20 - autosuggestion , semantic check and query formatting Features