Re: Support for REINDEX CONCURRENTLY

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Support for REINDEX CONCURRENTLY
Date: 2013-03-28 01:35:40
Message-ID: 20130328013540.GB19403@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-03-19 08:57:31 +0900, Michael Paquier wrote:
> On Tue, Mar 19, 2013 at 3:24 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> > On Wed, Mar 13, 2013 at 9:04 PM, Michael Paquier
> > <michael(dot)paquier(at)gmail(dot)com> wrote:
> > > I have been working on improving the code of the 2 patches:
> > > 1) reltoastidxid removal:
> > <snip>
> > > - Fix a bug with pg_dump and binary upgrade. One valid index is necessary
> > > for a given toast relation.
> >
> > Is this bugfix related to the following?
> >
> > appendPQExpBuffer(upgrade_query,
> > - "SELECT c.reltoastrelid,
> > t.reltoastidxid "
> > + "SELECT c.reltoastrelid,
> > t.indexrelid "
> > "FROM pg_catalog.pg_class c LEFT
> > JOIN "
> > - "pg_catalog.pg_class t ON
> > (c.reltoastrelid = t.oid) "
> > - "WHERE c.oid =
> > '%u'::pg_catalog.oid;",
> > + "pg_catalog.pg_index t ON
> > (c.reltoastrelid = t.indrelid) "
> > + "WHERE c.oid =
> > '%u'::pg_catalog.oid AND t.indisvalid "
> > + "LIMIT 1",
> >
> Yes.
>
>
> > Don't indisready and indislive need to be checked?
> >
> An index is valid if it is already ready and line. We could add such check
> for safely but I don't think it is necessary.

Note that thats not true for 9.2. live && !ready represents isdead there, since
the need for that was only recognized after the release.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-03-28 02:16:22 Re: JSON Function Bike Shedding
Previous Message Andres Freund 2013-03-28 01:34:06 Re: Support for REINDEX CONCURRENTLY