Re: Online index builds - Mailing list pgsql-general

From Tom Lane
Subject Re: Online index builds
Date
Msg-id 27656.1165966837@sss.pgh.pa.us
Whole thread Raw
In response to Re: Online index builds  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Online index builds  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> My point was that, because we can run it in multiple transactions, can't
> we drop the nonexclusive lock before acquiring the exclusive lock,

No.  What happens if someone renames the table out from under you, to
mention just one possibility?  If you've been holding nonexclusive lock
for a long time (as you would've been) there's a nontrivial chance that
someone is already queued up for an exclusive lock and will get in
before you do.

            regards, tom lane

pgsql-general by date:

Previous
From: Brian Wipf
Date:
Subject: Re: Statement timeout not working on broken connections with active queries
Next
From: Glen Parker
Date:
Subject: Re: PITR and moving objects between table spaces