Thread: postgres timeout.

postgres timeout.

From
Stef
Date:
Hi all ,

I'm trying to find out if there is a specific setting
to make transactions time out faster in a scenario
where there's an update on a table in a transaction
block, and another update process tries to update
the same column.

It looks like the second process will wait until you
end the transaction block in the first transaction.

I've looked at the deadlock timeout parameter and
other parameters, but I don't think I found  what
I'm looking for.

I basically need to be able to let the second process
exit with an error after waiting 5 - 10 seconds.

Please can someone help?

Kind Regards
Stefan

Re: [SQL] postgres timeout.

From
Tom Lane
Date:
Stef <svb@ucs.co.za> writes:
> I'm trying to find out if there is a specific setting
> to make transactions time out faster in a scenario
> where there's an update on a table in a transaction
> block, and another update process tries to update
> the same column.

> It looks like the second process will wait until you
> end the transaction block in the first transaction.

You can use statement_timeout to limit the wait.

            regards, tom lane

Re: postgres timeout. [SOLVED]

From
Stef
Date:
Hi all,

It seems I always find a solution just after
panicking a little bit.
Anyway, I found that statement_timeout solved
my problem. When I tested it earlier, I actually
made an error, and skipped it as a possible
solution.

Cheers
Stef

Stef mentioned :
=> Forgot to mention that I use postgres 7.3.4
=>
=> Stef mentioned :
=> => Hi all ,
=> =>
=> => I'm trying to find out if there is a specific setting
=> => to make transactions time out faster in a scenario
=> => where there's an update on a table in a transaction
=> => block, and another update process tries to update
=> => the same column.
=> =>
=> => It looks like the second process will wait until you
=> => end the transaction block in the first transaction.
=> =>
=> => I've looked at the deadlock timeout parameter and
=> => other parameters, but I don't think I found  what
=> => I'm looking for.
=> =>
=> => I basically need to be able to let the second process
=> => exit with an error after waiting 5 - 10 seconds.
=> =>
=> => Please can someone help?
=> =>
=> => Kind Regards
=> => Stefan
=> =>
=>

Re: postgres timeout.

From
Stef
Date:
Forgot to mention that I use postgres 7.3.4

Stef mentioned :
=> Hi all ,
=>
=> I'm trying to find out if there is a specific setting
=> to make transactions time out faster in a scenario
=> where there's an update on a table in a transaction
=> block, and another update process tries to update
=> the same column.
=>
=> It looks like the second process will wait until you
=> end the transaction block in the first transaction.
=>
=> I've looked at the deadlock timeout parameter and
=> other parameters, but I don't think I found  what
=> I'm looking for.
=>
=> I basically need to be able to let the second process
=> exit with an error after waiting 5 - 10 seconds.
=>
=> Please can someone help?
=>
=> Kind Regards
=> Stefan
=>