Re: do postgresql this job for me ? (firebird user)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: do postgresql this job for me ? (firebird user)
Date: 2009-05-25 14:39:40
Message-ID: 3027.1243262380@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> The locking docs:
> http://www.postgresql.org/docs/8.3/static/explicit-locking.html
> don't say anything about which lock DROP INDEX takes on a relation. A
> quick test shows it takes an AccessExclusiveLock on the affected index,
> and appears to take no lock at all on the table:

Not sure how you tested that, but index_drop() clearly takes
AccessExclusiveLock on the table too. (I'm not sure it really needs
to --- the comment therein defending the reasoning seems out of date
--- but it definitely does.)

Whether it did lock the table or not, though, the index lock would
certainly interfere with queries trying to use that index, or even just
considering using the index during planning. So the recommended
method (CREATE new index, DROP old, RENAME) is designed to hold lock
on the old index for as short a time as possible.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bayless Kirtley 2009-05-25 14:43:07 Re: Daylight saving time question
Previous Message raul.giucich 2009-05-25 12:21:57 Re: Query