Remove invalid indexes from pg_dump Was: Support for REINDEX CONCURRENTLY

Started by Michael Paquierabout 13 years ago2 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi,

On Sun, Mar 17, 2013 at 9:24 PM, Michael Paquier

<michael.paquier@gmail.com> wrote:

Please find attached the patches wanted:
- 20130317_dump_only_valid_index.patch, a 1-line patch that makes

pg_dump

not take a dump of invalid indexes. This patch can be backpatched to

9.0.

The patch seems to change pg_dump so that it ignores an invalid index only
when the remote server version >= 9.0. But why not when the remote server
version < 9.0?
I think that you should start new thread to get much attention about this

patch

if there is no enough feedback.

If failures happen with CREATE INDEX CONCURRENTLY, the system will be let
with invalid indexes. I don't think that the user would like to see invalid
indexes of
an existing system being recreated as valid after a restore.
So why not removing from a dump invalid indexes with something like the
patch
attached?
This should perhaps be applied in pg_dump for versions down to 8.2 where
CREATE
INDEX CONCURRENTLY has been implemented?

I noticed some recent discussions about that:
/messages/by-id/20121207141236.GB4699@alvh.no-ip.org
In this case the problem has been fixed in pg_upgrade directly.

Regards,
--
Michael

Attachments:

20130317_dump_only_valid_index.patchapplication/octet-stream; name=20130317_dump_only_valid_index.patchDownload+1-0
#2Fujii Masao
masao.fujii@gmail.com
In reply to: Michael Paquier (#1)
Re: Remove invalid indexes from pg_dump Was: Support for REINDEX CONCURRENTLY

On Tue, Mar 19, 2013 at 9:19 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

If failures happen with CREATE INDEX CONCURRENTLY, the system will be let
with invalid indexes. I don't think that the user would like to see invalid
indexes of
an existing system being recreated as valid after a restore.
So why not removing from a dump invalid indexes with something like the
patch
attached?

+1

The patch looks good to me.

This should perhaps be applied in pg_dump for versions down to 8.2 where
CREATE
INDEX CONCURRENTLY has been implemented?

I think so.

Regards,

--
Fujii Masao

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers