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

pgsql: Apply a simple solution to the problem of making

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Apply a simple solution to the problem of making
Date: 2006-09-02 17:06:52
Message-ID: 20060902170652.E276C9FB4D4@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Apply a simple solution to the problem of making INSERT/UPDATE/DELETE
RETURNING play nice with views/rules.  To wit, have the rule rewriter
rewrite any RETURNING clause found in a rule to produce what the rule's
triggering query asked for in its RETURNING clause, in particular drop
the RETURNING clause if no RETURNING in the triggering query.  This
leaves the responsibility for knowing how to produce the view's output
columns on the rule author, without requiring any fundamental changes
in rule semantics such as adding new rule event types would do.  The
initial implementation constrains things to ensure that there is
exactly one, unconditionally invoked RETURNING clause among the rules
for an event --- later we might be able to relax that, but for a post
feature freeze fix it seems better to minimize how much invention we do.
Per gripe from Jaime Casanova.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        rules.sgml (r1.45 -> r1.46)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/rules.sgml.diff?r1=1.45&r2=1.46)
    pgsql/doc/src/sgml/ref:
        create_rule.sgml (r1.45 -> r1.46)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/create_rule.sgml.diff?r1=1.45&r2=1.46)
    pgsql/src/backend/rewrite:
        rewriteDefine.c (r1.112 -> r1.113)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteDefine.c.diff?r1=1.112&r2=1.113)
        rewriteHandler.c (r1.165 -> r1.166)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteHandler.c.diff?r1=1.165&r2=1.166)
    pgsql/src/test/regress/expected:
        returning.out (r1.2 -> r1.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/returning.out.diff?r1=1.2&r2=1.3)
    pgsql/src/test/regress/sql:
        returning.sql (r1.2 -> r1.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/returning.sql.diff?r1=1.2&r2=1.3)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2006-09-02 17:08:10
Subject: pgsql: Remove GUC_REPORT for new "server_version_num" GUC variable.
Previous:From: Bruce MomjianDate: 2006-09-02 17:05:29
Subject: pgsql: Add functions to /contrib/pgstattuple that show index statistics

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