public inbox for [email protected]
help / color / mirror / Atom feedSet timeout just on a query?
4+ messages / 3 participants
[nested] [flat]
* Set timeout just on a query?
@ 2022-05-10 00:58 Shaozhong SHI <[email protected]>
0 siblings, 2 replies; 4+ messages in thread
From: Shaozhong SHI @ 2022-05-10 00:58 UTC (permalink / raw)
To: pgsql-sql <[email protected]>
Can timeout be set just on a query?
Can we do the following?
Begin
do a query
set timeout
Exception
report a record
End;
Regards,
David
^ permalink raw reply [nested|flat] 4+ messages in thread
* Set timeout just on a query?
@ 2022-05-10 00:59 Shaozhong SHI <[email protected]>
parent: Shaozhong SHI <[email protected]>
1 sibling, 1 reply; 4+ messages in thread
From: Shaozhong SHI @ 2022-05-10 00:59 UTC (permalink / raw)
To: pgsql-general <[email protected]>
Can timeout be set just on a query?
Can we do the following?
Begin
do a query
set timeout
Exception
report a record
End;
Regards,
David
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Set timeout just on a query?
@ 2022-05-10 01:00 Christophe Pettus <[email protected]>
parent: Shaozhong SHI <[email protected]>
1 sibling, 0 replies; 4+ messages in thread
From: Christophe Pettus @ 2022-05-10 01:00 UTC (permalink / raw)
To: Shaozhong SHI <[email protected]>; +Cc: pgsql-sql <[email protected]>
> On May 9, 2022, at 17:58, Shaozhong SHI <[email protected]> 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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Set timeout just on a query?
@ 2022-05-10 03:56 Bharath Rupireddy <[email protected]>
parent: Shaozhong SHI <[email protected]>
0 siblings, 0 replies; 4+ messages in thread
From: Bharath Rupireddy @ 2022-05-10 03:56 UTC (permalink / raw)
To: Shaozhong SHI <[email protected]>; +Cc: pgsql-general <[email protected]>
On Tue, May 10, 2022 at 6:29 AM Shaozhong SHI <[email protected]> wrote:
>
>
> Can timeout be set just on a query?
>
> Can we do the following?
>
> Begin
>
> do a query
> set timeout
> Exception
> report a record
>
> End;
Won't the statement_timeout [1] help here?
[1] https://www.postgresql.org/docs/devel/runtime-config-client.html
Regards,
Bharath Rupireddy.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2022-05-10 03:56 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 00:58 Set timeout just on a query? Shaozhong SHI <[email protected]>
2022-05-10 00:59 ` Shaozhong SHI <[email protected]>
2022-05-10 03:56 ` Bharath Rupireddy <[email protected]>
2022-05-10 01:00 ` Christophe Pettus <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox