pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: amul sul <sulamul@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key
Date: Thu, 5 Apr 2018 16:34:54 -0300
Message-ID: <20180405193454.el2bffwijtsa7rbg@alvherre.pgsql> (raw)
In-Reply-To: <CABOikdOS9+iq+j-ZtKAmXwEtdgXXvJPQxED14nAU5j8F17wTXg@mail.gmail.com>

Pavan Deolasee wrote:
> On Thu, Apr 5, 2018 at 7:14 AM, Andres Freund <andres@anarazel.de> wrote:

> +           /*
> +            * As long as we don't support an UPDATE of INSERT ON CONFLICT for
> +            * a partitioned table we shouldn't reach to a case where tuple to
> +            * be lock is moved to another partition due to concurrent update
> +            * of the partition key.
> +            */
> +           Assert(!ItemPointerIndicatesMovedPartitions(&hufd.ctid));
> +
> 
> This is no longer true; at least not entirely. We still don't support ON
> CONFLICT DO UPDATE to move a row to a different partition, but otherwise it
> works now. See 555ee77a9668e3f1b03307055b5027e13bf1a715.

Right.  So I think the assert() should remain, but the comment should
say "As long as we don't update moving a tuple to a different partition
during INSERT ON CONFLICT DO UPDATE on a partitioned table, ..."

FWIW I think the code flow is easier to read with the renamed macros.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (84+ messages)  latest in thread

Message-ID: <20180405193454.el2bffwijtsa7rbg@alvherre.pgsql>
Permalink:  ../20180405193454.el2bffwijtsa7rbg@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180405193454.el2bffwijtsa7rbg@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, pavan.deolasee@gmail.com, andres@anarazel.de, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, sulamul@gmail.com, amit.kapila16@gmail.com, sfrost@snowman.net
  Subject: Re: [HACKERS] Restrict concurrent update/delete with UPDATE of partition key
  In-Reply-To: <20180405193454.el2bffwijtsa7rbg@alvherre.pgsql>

* 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