Vaccum Query

Started by PAWAN SHARMAalmost 9 years ago2 messagesgeneral
Jump to latest
#1PAWAN SHARMA
er.pawanshr0963@gmail.com

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 ? If
so, how long ? If not, then what ?

And what actions can be taken to prevent this ?

*Thanks & Regards,Pawan Sharma*
*+91-9899396940*
*Skpye ID: pawanshr.0963*
*Think… before you print(Save Environment)*

#2Vik Fearing
vik@postgresfriends.org
In reply to: PAWAN SHARMA (#1)
Re: Vaccum Query

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