Re: Support for REINDEX CONCURRENTLY

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(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-18 18:24:34
Message-ID: CAHGQGwFgD1yHwfb_15x18u4DjZ0vR0g5sm7bJtp_BhmyM=v_EA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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",

Don't indisready and indislive need to be checked?

Why is LIMIT 1 required? The toast table can have more than one toast indexes?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-03-18 18:24:37 Re: Enabling Checksums
Previous Message Pavel Stehule 2013-03-18 18:21:44 Re: Enabling Checksums