Ticket #159 (closed bug: fixed)

Opened 23 months ago

Last modified 23 months ago

Reverse engineering of a function that RETURNS TABLE

Reported by: brsa Owned by: gleu
Priority: minor Milestone: 1.10.3
Component: pgadmin Version: 1.10
Keywords: SQL pane Cc:
Platform: all

Description

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;

Change History

Changed 23 months ago by gleu

  • status changed from new to assigned
  • owner changed from dpage to gleu

Changed 23 months ago by gleu

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone set to 1.10.3

Fixed in r8248 and r8249.

Note: See TracTickets for help on using tickets.