Re: Lock problem - Mailing list pgsql-general

From Igor Neyman
Subject Re: Lock problem
Date
Msg-id A76B25F2823E954C9E45E32FA49D70EC7A9C3B34@mail.corp.perceptron.com
Whole thread Raw
In response to Re: Lock problem  ("Victor Sterpu" <victor@caido.ro>)
Responses Re: Lock problem
List pgsql-general

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Victor Sterpu
> Sent: Wednesday, April 02, 2014 2:25 PM
> To: Victor Sterpu; Merlin Moncure
> Cc: PostgreSQL General
> Subject: Re: [GENERAL] Lock problem
> 
> I'm sure is not right, but is a there a server side solution for such sitations?
> A configuration - timeout for idle transactions.
> 

I don't think PG has such configuration parameter.
But, you could easily write a function (say in PgPlSQL) and run it on schedule, where you could check "IDLE IN
TRANSACTION"session and compare their start_time to system time, and then based on your criteria you could kill suspect
session/transaction.
But this could be dangerous;  some long-running transactions could be perfectly valid.

Regards,
Igor Neyman

pgsql-general by date:

Previous
From: Steve Atkins
Date:
Subject: Re: COPY v. java performance comparison
Next
From: Shaun Thomas
Date:
Subject: Re: SSD Drives