Re: Set timeout just on a query?

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Set timeout just on a query?
Date: 2022-05-10 01:00:08
Message-ID: 25AF5D7A-0479-43D2-8427-100489E76F29@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

> On May 9, 2022, at 17:58, Shaozhong SHI <shishaozhong(at)gmail(dot)com> wrote:
> Begin
>
> do a query
> set timeout
> Exception
> report a record
>
> End;

Yes. The syntax you are looking for is:

SET LOCAL statement_timeout = '<value>';

Best,
-- Christophe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bharath Rupireddy 2022-05-10 03:56:47 Re: Set timeout just on a query?
Previous Message Shaozhong SHI 2022-05-10 00:59:05 Set timeout just on a query?

Browse pgsql-sql by date

  From Date Subject
Next Message Bharath Rupireddy 2022-05-10 03:56:47 Re: Set timeout just on a query?
Previous Message Shaozhong SHI 2022-05-10 00:59:05 Set timeout just on a query?