Re: Exclusive lock for database rename

From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Exclusive lock for database rename
Date: 2005-11-03 19:40:15
Message-ID: slrndmkpsv.g61.andrew+nonews@trinity.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2005-11-03, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Peter Eisentraut wrote:
>> Someone wanted to rename a database while someone else was running a
>> rather long pg_dump, so the rename had to wait, and everyone else had
>> to wait for the rename because no new connections would be allowed.
>
> As an auxiliary issue, why do the new connections have to wait in this
> case? The rename waits for the AccessShareLock of the dump to be
> released, but meanwhile new connections should be able to get
> AccessShareLocks of their own.

No. New AccessShare locks block behind the pending AccessExclusive lock.
Otherwise AccessShare locks could starve the exclusive lock forever.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2005-11-03 19:41:18 Re: Reducing the overhead of NUMERIC data
Previous Message Gregory Maxwell 2005-11-03 19:06:02 Re: Reducing the overhead of NUMERIC data