Re: Ignore invalid indexes in pg_dump

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Josh Kupershmidt <schmiddy(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ignore invalid indexes in pg_dump
Date: 2013-03-21 00:51:39
Message-ID: CAB7nPqTzuN5UgBWfVcYaA6X14JyuaGg=i8-c4r61Vg9q22HsDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 21, 2013 at 12:58 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I had been on the fence about what to do here, but I find Josh's
> arguments persuasive, particularly the second one. Why shouldn't we
> consider an in-progress index to be an uncommitted DDL change?
>
> (Now admittedly, there won't *be* any uncommitted ordinary DDL on tables
> while pg_dump is running, because it takes AccessShareLock on all
> tables. But there could easily be uncommitted DDL against other types
> of database objects, which pg_dump won't even see.)
>
+1. Playing it safe is a better thing to do for sure, especially if a
restore would
fail. I didn't think about that first...

On top of checking indisvalid, I think that some additional checks on
indislive
and indisready are also necessary. As indisready has been introduced in 8.3
and
indislive has been added in 9.3, the attached patch is good I think.
I also added a note in the documentation about invalid indexes not being
dumped.
Perhaps this patch should be backpatched to previous versions in order to
have
the same consistent behavior.

Regards,
--
Michael

Attachment Content-Type Size
20130321_no_dump_indisvalid.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-03-21 01:48:00 Re: Let's invent a function to report lock-wait-blocking PIDs
Previous Message Brendan Jurd 2013-03-21 00:38:30 Single-argument variant for array_length and friends?