[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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgadmin-hackers by date

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