Skip site navigation (1) Skip section navigation (2)

Re: Ignore invalid indexes in pg_dump.

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Ignore invalid indexes in pg_dump.
Date: 2013-03-28 21:01:04
Message-ID: 20130328210104.GA2126@momjian.us (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Tue, Mar 26, 2013 at 09:43:54PM +0000, Tom Lane wrote:
> Ignore invalid indexes in pg_dump.
> 
> Dumping invalid indexes can cause problems at restore time, for example
> if the reason the index creation failed was because it tried to enforce
> a uniqueness condition not satisfied by the table's data.  Also, if the
> index creation is in fact still in progress, it seems reasonable to
> consider it to be an uncommitted DDL change, which pg_dump wouldn't be
> expected to dump anyway.
> 
> Back-patch to all active versions, and teach them to ignore invalid
> indexes in servers back to 8.2, where the concept was introduced.

This commit affects pg_upgrade.  You might remember we had to patch
pg_upgrade to prevent it from migrating clusters with invalid indexes in
December, 2012:

	http://momjian.us/main/blogs/pgblog/2012.html#December_14_2012

This was released on February 7, 2013 in 9.2.3 and other back branches:

	http://www.postgresql.org/docs/9.2/static/release-9-2-3.html

This git commit means that pg_upgrade can again migrate systems with
invalid indexes as pg_upgrade can just skip migrating them because
pg_dump will dump the SQL commands to create them --- previously
pg_upgrade threw an error.

Should I just patch pg_upgrade to remove the "indisvalid", skip
"indisvalid" indexes, and backpatch it?  Users should be using the
version of pg_upgrade to match new pg_dump.  Is there any case where
they don't match?  Do I still need to check for "indisready"?

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2013-03-28 21:17:43
Subject: Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Previous:From: Tomas VondraDate: 2013-03-28 20:50:35
Subject: Re: Call for Google Summer of Code mentors, admins

pgsql-committers by date

Next:From: Tom LaneDate: 2013-03-28 21:27:28
Subject: Re: Ignore invalid indexes in pg_dump.
Previous:From: Robert HaasDate: 2013-03-28 19:57:58
Subject: Re: [COMMITTERS] pgsql: sepgsql: Support for new post-ALTER access hook.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group