Setof-returning function create script bug - Mailing list pgadmin-support

From Stefan Stefanov
Subject Setof-returning function create script bug
Date
Msg-id 1175973223.4140288.1448565501797.JavaMail.apache@nm31.abv.bg
Whole thread Raw
Responses Re: Setof-returning function create script bug  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Debugger freeze  (Stefan Stefanov <stefanov.sm@abv.bg>)
List pgadmin-support
Dear Sir or Madam,<br />I am writing to report a bug in pgadmin III 1.22.0-beta1 running on Windows 7 x64 connected to
PostgreSQL9.5beta2 64 bit.<br />To reproduce the bug create this function using SQL query editor:<br /><br /><font
face="CourierNew">create or replace function afunc() returns setof record as<br />$$<br />begin<br /> return next (1,
2,3);<br /> return next (2, 3, 4);<br />end;<br />$$ language plpgsql;</font><br /><br />The function works fine when
invokedwith a query like this one<br /><br /><font face="Courier New">select * from afunc() as x(a integer, b integer,
cinteger);</font><br /><br />However when the function is selected in Object browser this is what appears in the SQL
pane:<br/><br /><font face="Courier New">-- Function: public.afunc()<br /><br />-- DROP FUNCTION public.afunc();<br
/><br/>CREATE OR REPLACE FUNCTION public.afunc()<br />  RETURNS SETOF SETOF record AS<br />$BODY$<br />begin<br
/>returnnext (1, 2, 3);<br />return next (2,3,4);<br />end;<br />$BODY$<br />  LANGUAGE plpgsql VOLATILE<br />  COST
100<br/>  ROWS 1000;<br />ALTER FUNCTION public.afunc()<br />  OWNER TO postgres;</font><br /><br />There are two
SETOF-safter the RETURNS declaration and this makes the code invalid. Rightclick-Scripts-Create script produces the
same.<br/>The bug appeared on pgadmin III 1.18 running on windows xp connected to 32-bit Postgresql 9.2 as well.<br
/>Itis not really a show stopper yet annoying.<br /><br />Thank you for the great job you are doing.<br />Sincerely,
Stefan

pgadmin-support by date:

Previous
From: Michal Kozusznik
Date:
Subject: Re: Re: PG admin 111 v 1.20 - autosuggestion , semantic check and query formatting Features
Next
From: Per Wigren
Date:
Subject: Greenplum warning message