pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Arseny Sher <a.sher@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: Indexes on partitioned tables and foreign partitions
Date: Mon, 14 May 2018 13:29:10 -0400
Message-ID: <20180514172910.wjuvrtcdhcc5y3u7@alvherre.pgsql> (raw)
In-Reply-To: <211ee61d-f91a-9cbd-7b9b-6cd81cb8d08d@lab.ntt.co.jp>

On 2018-May-10, Amit Langote wrote:

> How about we error out even *before* calling DefineIndex for the 1st time?
>  I see that ProcessUtilitySlow() gets a list of all partitions when
> locking them for index creation before calling DefineIndex.  Maybe, just
> go through the list and error out if one of them is a partition that we
> don't support creating an index on?

The overwhelming consensus seems to be for this option, so I pushed your
patch after some small tweaks -- mostly to simplify unnecessarily
baroque code.  (I must have been thinking that recursion would happen
right in ProcessUtilitySlow.  That doesn't match my memories, but I
can't explain this code otherwise.)  I added a very small test too.

I think it'd be better to take this out of ProcessUtility also and into
DefineInde, for cleanliness sake; maybe add a 'recursing' flag to
DefineIndex.  Not for pg11, though.

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




view thread (25+ messages)  latest in thread

Message-ID: <20180514172910.wjuvrtcdhcc5y3u7@alvherre.pgsql>
Permalink:  ../20180514172910.wjuvrtcdhcc5y3u7@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180514172910.wjuvrtcdhcc5y3u7@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@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, michael@paquier.xyz, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, simon@2ndquadrant.com, a.sher@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: Indexes on partitioned tables and foreign partitions
  In-Reply-To: <20180514172910.wjuvrtcdhcc5y3u7@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