Re: Support for REINDEX CONCURRENTLY - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Support for REINDEX CONCURRENTLY
Date
Msg-id CAB7nPqS_o6-x161BQ8tvJ3k6Y6dnY0h66G7UVho8YitH2uD5UA@mail.gmail.com
Whole thread
In response to Re: Support for REINDEX CONCURRENTLY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Dec 8, 2012 at 2:01 AM, Tom Lane <tgl@sss.pgh.pa.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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Support for REINDEX CONCURRENTLY
Next
From: Michael Paquier
Date:
Subject: Re: [WIP] pg_ping utility