Re: Autovacuum stuck for hours, blocking queries

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Rakesh Kumar <rakeshkumar464(at)outlook(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Autovacuum stuck for hours, blocking queries
Date: 2017-02-18 07:54:10
Message-ID: CAB7nPqRKQr6+i+dDfLpC2Yq1HaVTx=B=WFXdNddngON8uygaHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Feb 18, 2017 at 1:32 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> Yes it can. Truncate has been rollbackable for a while now.

Per the docs:
https://www.postgresql.org/docs/9.6/static/sql-truncate.html
"TRUNCATE is transaction-safe with respect to the data in the tables:
the truncation will be safely rolled back if the surrounding
transaction does not commit."
In short yes a transaction doing a truncate can be rollbacked.
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-02-18 15:02:36 Re: Autovacuum stuck for hours, blocking queries
Previous Message Scott Marlowe 2017-02-18 04:32:05 Re: Autovacuum stuck for hours, blocking queries