[pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE - Mailing list pgadmin-hackers

From pgAdmin Trac
Subject [pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE
Date
Msg-id 045.5f22c9277fcd7cebfb3a38af26e76c22@code.pgadmin.org
Whole thread Raw
Responses Re: [pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE
Re: [pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE
List pgadmin-hackers
#159: Reverse engineering of a function that RETURNS TABLE
----------------------+-----------------------------------------------------
 Reporter:  brsa      |       Owner:  dpage
     Type:  bug       |      Status:  new  
 Priority:  minor     |   Milestone:       
Component:  pgadmin   |     Version:  1.10 
 Keywords:  SQL pane  |    Platform:  all  
----------------------+-----------------------------------------------------
 The feature is new in pg 8.4 and a search in trac shows that Ashesh added
 the functionality in changeset 7815 on April, 17th 2009.

 However, the display in the SQL pane of pgAdmin 1.10.2 is wrong. It says
 "RETURNS SETOF record"; OUT parameters are lost.

 Demo:
   -- I say --
 CREATE OR REPLACE FUNCTION f_test()
   RETURNS TABLE (x integer, y text) AS
 $BODY$
 BEGIN

 x := 1; y := 'test'; RETURN NEXT;

 RETURN QUERY SELECT '2'::int4, 'test2'::text;

 END;
 $BODY$
   LANGUAGE 'plpgsql' VOLATILE


   -- pgAmin say --
 CREATE OR REPLACE FUNCTION f_test()
   RETURNS SETOF record AS
 $BODY$
 BEGIN

 x := 1; y := 'test';
 RETURN NEXT;

 RETURN QUERY
 SELECT 2::int4, 'test2'::text;

 END;
 $BODY$
   LANGUAGE 'plpgsql' VOLATILE
   COST 100
   ROWS 1000;
 ALTER FUNCTION f_test() OWNER TO postgres;

--
Ticket URL: <http://code.pgadmin.org/trac/ticket/159>
pgAdmin III <http://code.pgadmin.org/trac/>
pgAdmin III

pgadmin-hackers by date:

Previous
From: Erwin Brandstetter
Date:
Subject: Re: pgadmin 1.10.2 crashes on start
Next
From: Erwin Brandstetter
Date:
Subject: Bug with create function ... RETURNS TABLE