Re: pg_upgrade problem with invalid indexes - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_upgrade problem with invalid indexes
Date
Msg-id 20121207135804.GD31540@momjian.us
Whole thread Raw
In response to Re: pg_upgrade problem with invalid indexes  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_upgrade problem with invalid indexes
List pgsql-hackers
On Thu, Dec  6, 2012 at 09:23:14PM -0500, Bruce Momjian wrote:
> On Thu, Dec  6, 2012 at 09:10:21PM -0500, Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > On Thu, Dec  6, 2012 at 07:53:57PM -0500, Tom Lane wrote:
> > >> Because CREATE INDEX CONCURRENTLY can't drop the index if it's already
> > >> failed.  It's not because we want to do that, it's an implementation
> > >> restriction of the horrid kluge that is CREATE/DROP INDEX CONCURRENTLY.
> > 
> > > Well, what is the logic that pg_dump dumps it then, even in
> > > non-binary-upgrade mode?
> > 
> > Actually, I was thinking about proposing exactly that.  Ideally the
> > system should totally ignore an invalid index (we just fixed some bugs
> > in that line already).  So it would be perfectly consistent for pg_dump
> > to ignore it too, with or without --binary-upgrade.
> > 
> > One possible spanner in the works for pg_upgrade is that this would mean
> > there can be relation files in the database directories that it should
> > ignore (not transfer over).  Dunno if that takes any logic changes.
> 
> As soon as pg_dump stopped dumping the CREATE INDEX, pg_upgrade would
> stop creating creating it in the new cluster, and not transfer the index
> files.

Sorry, I was wrong about this.  We would need to modify pg_dump to skip
invalid indexes (perhaps only for --binary-upgrade), and pg_upgrade
would also need to be modified to skip such indexes.  This is necessary
because, as a safety check, pg_upgrade requires there to be an exact
match of relations between old and new clusters.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Support for REINDEX CONCURRENTLY
Next
From: Alvaro Herrera
Date:
Subject: Re: pg_upgrade problem with invalid indexes