Statement_timeout in procedure block

From: Teja Jakkidi <teja(dot)jakkidi05(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Statement_timeout in procedure block
Date: 2024-06-18 22:11:39
Message-ID: E0175C30-9A8F-4648-A2D5-36908FF6F695@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello PgAdmins,

We have a Postgres instance where we had set statement_timeout to 1hour at instance level.
However, today we noticed that one of our cron jobs which calls a stored procedure failed with timeout error as it was running for more than an hour.
I tried setting “Set local statement_timeout=‘2 h’” within the stored procedure expecting that the statement timeout will be 2hours for the SP execution. However it did not work as expected.
Can anyone please suggest what can be done here.

Thanks in advance,
J. Teja.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Wells Oliver 2024-06-18 22:28:53 Materialized views & dead tuples
Previous Message Vitale, Anthony, Sony Music 2024-06-18 22:02:13 RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER