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

plpsm - plpgpsm: table expression this patch allows table expression in

From: okbob(at)pgfoundry(dot)org (User Okbob)
To: pgsql-committers(at)postgresql(dot)org
Subject: plpsm - plpgpsm: table expression this patch allows table expression in
Date: 2007-02-05 17:57:52
Message-ID: 20070205175752.8AF17217280@pgfoundry.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
table expression

this patch allows table expression in SRF functions. Allow SELECT statement
as argument of RETURN statement or SELECT (everything which returns table)
as one statement's body.

See:
CREATE OR REPLACE FUNCTION fx(a int)
RETURNS SETOF RECORD AS 
$$
  RETURN SELECT * 
            FROM Foo
           WHERE fx.a = Foo.a;
$$ LANGUAGE plpgpsm;

CREATE OR REPLACE fx2(a int)
RETURNS SETOF RECORD AS
$$
  SELECT * 
     FROM Foo
   WHERE fx.a = Foo.a;
$$ LANGUAGE plpgpsm;

Modified Files:
--------------
    plpgpsm/src:
        gram.y (r1.33 -> r1.34)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/gram.y.diff?r1=1.33&r2=1.34)
        pl_comp.c (r1.11 -> r1.12)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/pl_comp.c.diff?r1=1.11&r2=1.12)
        pl_exec.c (r1.35 -> r1.36)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/pl_exec.c.diff?r1=1.35&r2=1.36)
        plpgpsm.h (r1.24 -> r1.25)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/plpgpsm.h.diff?r1=1.24&r2=1.25)
        scan.l (r1.9 -> r1.10)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/scan.l.diff?r1=1.9&r2=1.10)
    plpgpsm/src/expected:
        plpgpsm.out (r1.9 -> r1.10)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/expected/plpgpsm.out.diff?r1=1.9&r2=1.10)
    plpgpsm/src/sql:
        plpgpsm.sql (r1.8 -> r1.9)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/plpsm/plpgpsm/src/sql/plpgpsm.sql.diff?r1=1.8&r2=1.9)

pgsql-committers by date

Next:From: User OkbobDate: 2007-02-05 21:54:10
Subject: plpsm - plpgpsm: add check which protect combination of return table
Previous:From: Bruce MomjianDate: 2007-02-05 17:17:13
Subject: pgsql: Updated TODO item: > o Add a \set variable to control whether

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