pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Maksim Milyutin <m.milyutin@postgrespro.ru>
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Date: Tue, 14 Nov 2017 13:30:28 +0100
Message-ID: <20171114123027.3z7l75gg4cfuy24v@alvherre.pgsql> (raw)
In-Reply-To: <CAKJS1f_m-PbyOZg1H9Gtu4Eb=b7yrWPO-=TJCQhpLA8_a8qqSw@mail.gmail.com>

David Rowley wrote:
> On 15 November 2017 at 01:09, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > if a
> > partition exists which *doesn't* have the index, restoring things this
> > way would create the index in that partition too, which is unwanted
> > because the end state is different to what was in the dumped database.
> 
> hmm, but surely the all those indexes must already exist if the
> partitioned index exists. Won't we be disallowing DROP INDEX of the
> leaf partition indexes if that index is marked as being part of the
> partitioned index?

In normal cases, sure -- but you can do ALTER INDEX DETACH on a
partition, then drop the index.  This is useful for example if you want
to replace some partition's index because of bloat: create a replacement
index, detach the old one, attach the new one, drop the old one.  Now
you probably don't *want* to take a pg_dump in the middle of this
process ...  but pg_dump's charter is not to produce the output we think
would be most convenient to users most of the time, but rather to
accurately describe what is in the database.

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




view thread (142+ messages)  latest in thread

Message-ID: <20171114123027.3z7l75gg4cfuy24v@alvherre.pgsql>
Permalink:  ../20171114123027.3z7l75gg4cfuy24v@alvherre.pgsql/
Also on:    postgresql.org/message-id/20171114123027.3z7l75gg4cfuy24v@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, david.rowley@2ndquadrant.com, robertmhaas@gmail.com, m.milyutin@postgrespro.ru
  Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
  In-Reply-To: <20171114123027.3z7l75gg4cfuy24v@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