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

From Tom Lane
Subject Re: Support for REINDEX CONCURRENTLY
Date
Msg-id 13502.1349319089@sss.pgh.pa.us
Whole thread Raw
In response to Re: Support for REINDEX CONCURRENTLY  (Greg Stark <stark@mit.edu>)
Responses Re: Support for REINDEX CONCURRENTLY  (Michael Paquier <michael.paquier@gmail.com>)
Re: Support for REINDEX CONCURRENTLY  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> I'm a bit puzzled why we're so afraid of swapping the relfilenodes
> when that's what the current REINDEX does.

Swapping the relfilenodes is fine *as long as you have exclusive lock*.
The trick is to make it safe without that.  It will definitely not work
to do that without exclusive lock, because at the instant you would try
it, people will be accessing the new index (by OID).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Make CREATE AGGREGATE check validity of initcond value?
Next
From: Craig Ringer
Date:
Subject: Docs bug: SET ROLE docs should "see also: DISCARD ALL"