pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix ON CONFLICT bugs that manifest when used in rules.
Date: Tue, 12 May 2015 22:14:42 +0000
Message-ID: <E1YsIRm-0008Ol-6u@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YsIRm-0008Ol-6u@gemulon.postgresql.org>
Permalink:  ../E1YsIRm-0008Ol-6u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YsIRm-0008Ol-6u@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Fix ON CONFLICT bugs that manifest when used in rules.
  In-Reply-To: <E1YsIRm-0008Ol-6u@gemulon.postgresql.org>
  References: <E1YsIRm-0008Ol-6u@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox