Skip site navigation (1) Skip section navigation (2)

[pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE

From: "pgAdmin Trac" <trac(at)code(dot)pgadmin(dot)org>
To:
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: [pgAdmin III] #159: Reverse engineering of a function that RETURNS TABLE
Date: 2010-03-26 15:47:21
Message-ID: 045.5f22c9277fcd7cebfb3a38af26e76c22@code.pgadmin.org (view raw or flat)
Thread:
Lists: 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

Responses

pgadmin-hackers by date

Next:From: Erwin BrandstetterDate: 2010-03-26 15:51:38
Subject: Bug with create function ... RETURNS TABLE
Previous:From: Erwin BrandstetterDate: 2010-03-26 15:07:24
Subject: Re: pgadmin 1.10.2 crashes on start

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group