pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle INSERT .. ON CONFLICT with partitioned tables
Date: Mon, 26 Mar 2018 13:44:35 +0000
Message-ID: <E1f0SQN-0006Q4-P8@gemulon.postgresql.org> (raw)

Handle INSERT .. ON CONFLICT with partitioned tables

Commit eb7ed3f30634 enabled unique constraints on partitioned tables,
but one thing that was not working properly is INSERT/ON CONFLICT.
This commit introduces a new node keeps state related to the ON CONFLICT
clause per partition, and fills it when that partition is about to be
used for tuple routing.

Author: Amit Langote, Álvaro Herrera
Reviewed-by: Etsuro Fujita, Pavan Deolasee
Discussion: https://postgr.es/m/20180228004602.cwdyralmg5ejdqkq@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/555ee77a9668e3f1b03307055b5027e13bf1a715

Modified Files
--------------
doc/src/sgml/ddl.sgml                         |  15 --
doc/src/sgml/ref/insert.sgml                  |   8 +
src/backend/catalog/partition.c               |  88 ++++++++--
src/backend/executor/execMain.c               |   4 +
src/backend/executor/execPartition.c          | 233 ++++++++++++++++++++++++--
src/backend/executor/nodeModifyTable.c        |  74 ++++++--
src/backend/parser/analyze.c                  |   7 -
src/include/catalog/partition.h               |   1 +
src/include/nodes/execnodes.h                 |  22 ++-
src/include/nodes/nodes.h                     |   1 +
src/test/regress/expected/insert_conflict.out | 108 ++++++++++--
src/test/regress/expected/triggers.out        |  33 ++++
src/test/regress/sql/insert_conflict.sql      |  95 +++++++++--
src/test/regress/sql/triggers.sql             |  33 ++++
14 files changed, 638 insertions(+), 84 deletions(-)



Message-ID: <E1f0SQN-0006Q4-P8@gemulon.postgresql.org>
Permalink:  ../E1f0SQN-0006Q4-P8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f0SQN-0006Q4-P8@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Handle INSERT .. ON CONFLICT with partitioned tables
  In-Reply-To: <E1f0SQN-0006Q4-P8@gemulon.postgresql.org>
  References: <E1f0SQN-0006Q4-P8@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