Re: truncate table getting blocked - Mailing list pgsql-general

From Jayadevan M
Subject Re: truncate table getting blocked
Date
Msg-id CAFS1N4gh4CGCJKunk2WZu2V2w6i0pACXTJwFXYc2GbxptnoG0Q@mail.gmail.com
Whole thread Raw
In response to Re: truncate table getting blocked  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-general


On Tue, Apr 26, 2016 at 7:25 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:


It is not the "SET search_path" statement that is blocking the truncate,
but probably some earlier statement issued in the same transaction.

You are right. I had a select against that table. 
Adding  this line fixed it ...
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)

Reference - 

Thanks,
Jayadevan


pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: truncate table getting blocked
Next
From: Adrian Klaver
Date:
Subject: Re: Does frequent update of a row affects performance