pgsql: Fix ON CONFLICT bugs that manifest when used in rules.
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(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers