Re: idle_in_transaction_session_timeout for a set of SQL statements

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: idle_in_transaction_session_timeout for a set of SQL statements
Date: 2019-02-27 16:44:05
Message-ID: CAHOFxGoTc0V4CdqSJdb3+pVUeS=nETZrpzFi02SDV4rFHNvOUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 27, 2019 at 7:56 AM Jeremy Finzel <finzelj(at)gmail(dot)com> wrote:

> I was hoping to use idle_in_transaction_session_timeout to prevent schema
> change migrations from running too long and thereby locking up the
> application for an extended period even if any one statement in the
> migration is very short.
>

I don't think you are actually going idle. Check pg_stat_activity for what
this transaction is doing. It should show waiting on locks, but not idle. I
think the command you seek is

SET lock_timeout TO '1s';

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2019-02-27 16:49:12 Re: why not using a mountpoint as PGDATA?
Previous Message Filip Rembiałkowski 2019-02-27 16:00:22 Re: 9.0 standby - could not open file global/XXXXX