Thread: pgsql: Add INSERT/UPDATE/DELETE RETURNING, with basic docs and

pgsql: Add INSERT/UPDATE/DELETE RETURNING, with basic docs and

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Add INSERT/UPDATE/DELETE RETURNING, with basic docs and regression tests.
plpgsql support to come later.  Along the way, convert execMain's
SELECT INTO support into a DestReceiver, in order to eliminate some ugly
special cases.

Jonah Harris and Tom Lane

Modified Files:
--------------
    pgsql/doc/src/sgml/ref:
        delete.sgml (r1.26 -> r1.27)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/delete.sgml.diff?r1=1.26&r2=1.27)
        insert.sgml (r1.30 -> r1.31)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/insert.sgml.diff?r1=1.30&r2=1.31)
        update.sgml (r1.37 -> r1.38)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/update.sgml.diff?r1=1.37&r2=1.38)
    pgsql/src/backend/access/common:
        printtup.c (r1.97 -> r1.98)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/common/printtup.c.diff?r1=1.97&r2=1.98)
    pgsql/src/backend/commands:
        prepare.c (r1.59 -> r1.60)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.59&r2=1.60)
    pgsql/src/backend/executor:
        execMain.c (r1.277 -> r1.278)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execMain.c.diff?r1=1.277&r2=1.278)
        spi.c (r1.153 -> r1.154)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c.diff?r1=1.153&r2=1.154)
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.346 -> r1.347)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c.diff?r1=1.346&r2=1.347)
        equalfuncs.c (r1.280 -> r1.281)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c.diff?r1=1.280&r2=1.281)
        outfuncs.c (r1.281 -> r1.282)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c.diff?r1=1.281&r2=1.282)
        readfuncs.c (r1.194 -> r1.195)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c.diff?r1=1.194&r2=1.195)
    pgsql/src/backend/optimizer/plan:
        planagg.c (r1.20 -> r1.21)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c.diff?r1=1.20&r2=1.21)
        planner.c (r1.207 -> r1.208)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.207&r2=1.208)
        setrefs.c (r1.123 -> r1.124)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/setrefs.c.diff?r1=1.123&r2=1.124)
    pgsql/src/backend/optimizer/prep:
        prepjointree.c (r1.40 -> r1.41)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c.diff?r1=1.40&r2=1.41)
        preptlist.c (r1.82 -> r1.83)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/preptlist.c.diff?r1=1.82&r2=1.83)
    pgsql/src/backend/optimizer/util:
        clauses.c (r1.217 -> r1.218)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.217&r2=1.218)
    pgsql/src/backend/parser:
        analyze.c (r1.344 -> r1.345)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.344&r2=1.345)
        gram.y (r2.554 -> r2.555)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y.diff?r1=2.554&r2=2.555)
        keywords.c (r1.174 -> r1.175)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/keywords.c.diff?r1=1.174&r2=1.175)
    pgsql/src/backend/tcop:
        dest.c (r1.68 -> r1.69)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/dest.c.diff?r1=1.68&r2=1.69)
        pquery.c (r1.105 -> r1.106)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/pquery.c.diff?r1=1.105&r2=1.106)
        utility.c (r1.263 -> r1.264)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/utility.c.diff?r1=1.263&r2=1.264)
    pgsql/src/backend/utils/adt:
        ruleutils.c (r1.230 -> r1.231)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c.diff?r1=1.230&r2=1.231)
    pgsql/src/include/catalog:
        catversion.h (r1.348 -> r1.349)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h.diff?r1=1.348&r2=1.349)
    pgsql/src/include/executor:
        executor.h (r1.128 -> r1.129)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h.diff?r1=1.128&r2=1.129)
    pgsql/src/include/nodes:
        execnodes.h (r1.158 -> r1.159)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.158&r2=1.159)
        parsenodes.h (r1.321 -> r1.322)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h.diff?r1=1.321&r2=1.322)
    pgsql/src/include/optimizer:
        planmain.h (r1.94 -> r1.95)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h.diff?r1=1.94&r2=1.95)
    pgsql/src/include/tcop:
        dest.h (r1.50 -> r1.51)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/dest.h.diff?r1=1.50&r2=1.51)
    pgsql/src/include/utils:
        portal.h (r1.64 -> r1.65)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/portal.h.diff?r1=1.64&r2=1.65)
    pgsql/src/test/regress:
        parallel_schedule (r1.33 -> r1.34)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/parallel_schedule.diff?r1=1.33&r2=1.34)
        serial_schedule (r1.31 -> r1.32)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/serial_schedule.diff?r1=1.31&r2=1.32)

Added Files:
-----------
    pgsql/src/test/regress/sql:
        returning.sql (r1.1)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/returning.sql?rev=1.1&content-type=text/x-cvsweb-markup)
    pgsql/src/test/regress/expected:
        returning.out (r1.1)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/returning.out?rev=1.1&content-type=text/x-cvsweb-markup)