Re: Support for REINDEX CONCURRENTLY

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for REINDEX CONCURRENTLY
Date: 2012-12-08 12:31:13
Message-ID: CAB7nPqS_o6-x161BQ8tvJ3k6Y6dnY0h66G7UVho8YitH2uD5UA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 8, 2012 at 2:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Um, I don't think you can swap in a new toast index OID without taking
> exclusive lock on the parent table at some point.
>
> One sticking point is the need to update pg_class.reltoastidxid. I
> wonder how badly we need that field though --- could we get rid of it
> and treat toast-table indexes just the same as normal ones? (Whatever
> code is looking at the field could perhaps instead rely on
> RelationGetIndexList.)
>
Yes. reltoastidxid refers to the index of the toast table so it is
necessary to take a lock on the parent relation in this case. I haven't
thought of that. I also do not really know how far this is used by the
toast process, but just by thinking safety taking a lock on the parent
relation would be better.
For a normal index, locking the parent table is not necessary as we do not
need to modify anything in the parent relation entry in pg_class.
--
Michael Paquier
http://michael.otacoo.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2012-12-08 12:50:18 Re: [WIP] pg_ping utility
Previous Message Michael Paquier 2012-12-08 12:24:47 Re: Support for REINDEX CONCURRENTLY