Re: anonymous composite types for Table Functions (aka - Mailing list pgsql-patches
From | Bruce Momjian |
---|---|
Subject | Re: anonymous composite types for Table Functions (aka |
Date | |
Msg-id | 200208060534.g765YmT09608@candle.pha.pa.us Whole thread Raw |
In response to | Re: anonymous composite types for Table Functions (aka (Joe Conway <mail@joeconway.com>) |
List | pgsql-patches |
Patch applied. Thanks. --------------------------------------------------------------------------- Joe Conway wrote: > Joe Conway wrote: > > Simple change -- patch attached. > > Of course, the simple change has ripple effects! Here's a patch for the > rangefunc regression test for the new behavior. > > Joe > Index: src/test/regress/expected/rangefuncs.out > =================================================================== > RCS file: /opt/src/cvs/pgsql-server/src/test/regress/expected/rangefuncs.out,v > retrieving revision 1.2 > diff -c -r1.2 rangefuncs.out > *** src/test/regress/expected/rangefuncs.out 16 Jul 2002 05:53:34 -0000 1.2 > --- src/test/regress/expected/rangefuncs.out 5 Aug 2002 05:52:01 -0000 > *************** > *** 48,56 **** > -- sql, proretset = f, prorettype = b > CREATE FUNCTION getfoo(int) RETURNS int AS 'SELECT $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! getfoo > ! -------- > ! 1 > (1 row) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > --- 48,56 ---- > -- sql, proretset = f, prorettype = b > CREATE FUNCTION getfoo(int) RETURNS int AS 'SELECT $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! t1 > ! ---- > ! 1 > (1 row) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > *************** > *** 65,74 **** > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS setof int AS 'SELECT fooid FROM foo WHERE fooid = $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! getfoo > ! -------- > ! 1 > ! 1 > (2 rows) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > --- 65,74 ---- > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS setof int AS 'SELECT fooid FROM foo WHERE fooid = $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! t1 > ! ---- > ! 1 > ! 1 > (2 rows) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > *************** > *** 84,91 **** > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS setof text AS 'SELECT fooname FROM foo WHERE fooid = $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! getfoo > ! -------- > Joe > Ed > (2 rows) > --- 84,91 ---- > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS setof text AS 'SELECT fooname FROM foo WHERE fooid = $1;' LANGUAGE SQL; > SELECT * FROM getfoo(1) AS t1; > ! t1 > ! ----- > Joe > Ed > (2 rows) > *************** > *** 139,147 **** > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid =$1; RETURN fooint; END;' LANGUAGE 'plpgsql'; > SELECT * FROM getfoo(1) AS t1; > ! getfoo > ! -------- > ! 1 > (1 row) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > --- 139,147 ---- > DROP FUNCTION getfoo(int); > CREATE FUNCTION getfoo(int) RETURNS int AS 'DECLARE fooint int; BEGIN SELECT fooid into fooint FROM foo WHERE fooid =$1; RETURN fooint; END;' LANGUAGE 'plpgsql'; > SELECT * FROM getfoo(1) AS t1; > ! t1 > ! ---- > ! 1 > (1 row) > > CREATE VIEW vw_getfoo AS SELECT * FROM getfoo(1); > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
pgsql-patches by date: