Re: Can we set time exception? - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Can we set time exception?
Date
Msg-id CAKFQuwYVJpjs0Z-Fy3kbUYbg5tFWEK8Vi9cD_P3Gr-OiwPw9Aw@mail.gmail.com
Whole thread Raw
In response to Can we set time exception?  (Shaozhong SHI <shishaozhong@gmail.com>)
Responses Re: Can we set time exception?
List pgsql-sql
On Thu, Jul 13, 2023 at 7:46 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
In a Do statement, it calls function to work?

Can we set a time exception?

If the function responds with result in a given time, we take the result.

If the response of the function exceeds the time set, skip it.


No.  Function execution happens on a single thread (i.e., synchronous) in a stacked manner.  There is no way for the caller to get processing control back other than the callee returning.

If your choice of procedural language can overcome the synchronous execution limitation then sure.  SQL and pl/pgsql cannot.

David J.

pgsql-sql by date:

Previous
From: "Voillequin, Jean-Marc"
Date:
Subject: RE: Can we set time exception?
Next
From: Tom Lane
Date:
Subject: Re: Can we set time exception?