On Thu, Jul 13, 2023 at 7:46 AM Shaozhong SHI <shishaozhong(at)gmail(dot)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.