pgsql: Fix ON CONFLICT bugs that manifest when used in rules.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix ON CONFLICT bugs that manifest when used in rules.
Date: 2015-05-12 22:14:42
Message-ID: E1YsIRm-0008Ol-6u@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix ON CONFLICT bugs that manifest when used in rules.

Specifically the tlist and rti of the pseudo "excluded" relation weren't
properly treated by expression_tree_walker, which lead to errors when
excluded was referenced inside a rule because the varnos where not
properly adjusted. Similar omissions in OffsetVarNodes and
expression_tree_mutator had less impact, but should obviously be fixed
nonetheless.

A couple tests of for ON CONFLICT UPDATE into INSERT rule bearing
relations have been added.

In passing I updated a couple comments.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4af6e61a363246cf7fff3368a76603b0ce9945dd

Modified Files
--------------
src/backend/executor/nodeModifyTable.c | 1 +
src/backend/nodes/nodeFuncs.c | 3 +
src/backend/optimizer/plan/setrefs.c | 9 ++-
src/backend/rewrite/rewriteManip.c | 15 ++++-
src/test/regress/expected/rules.out | 105 +++++++++++++++++++++++++++++---
src/test/regress/sql/rules.sql | 35 ++++++++++-
6 files changed, 151 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2015-05-13 02:55:49 pgsql: PL/Python: Remove procedure cache invalidation
Previous Message Michael Paquier 2015-05-12 21:07:28 Re: pgsql: Allow on-the-fly capture of DDL event details