David Rowley wrote: > On 15 November 2017 at 01:09, Alvaro Herrera <alvhe...@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