Re: Vaccum Query

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: PAWAN SHARMA <er(dot)pawanshr0963(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Vaccum Query
Date: 2017-05-05 20:03:29
Message-ID: c9f77c03-3505-f377-da2f-d10e6b9a6804@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/04/2017 02:04 PM, PAWAN SHARMA wrote:
> Hi All,
>
> Any Idea what happens when we run standard vacuum (without full) on a
> table which has exclusive lock (or alter statement is being processed
> on that table).
>
> What happens in this case ? Will vacuum wait for the alter to commit ?
>

Yes.

> If so, how long ?
>

Either forever or for however long lock_timeout and/or statement_timeout
are set to (or any user command like Ctrl+C).

> If not, then what ?
>

If any of those limits are reached, the vacuum is cancelled.

> And what actions can be taken to prevent this ?
>

Prevent what? Even if the vacuum could run while the other transaction
had the exclusive lock, it wouldn't be able to do any work.

--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2017-05-05 20:19:25 Re: Caching and Blobs in PG? Was: Can PG replace redis, amqp, s3 in the future?
Previous Message Tony Finch 2017-05-05 18:52:42 Re: Can PG replace redis, amqp, s3 in the future?