| From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
|---|---|
| To: | Shaozhong SHI <shishaozhong(at)gmail(dot)com> |
| Cc: | pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Can we set time exception? |
| Date: | 2023-07-13 15:36:48 |
| Message-ID: | CAKFQuwYVJpjs0Z-Fy3kbUYbg5tFWEK8Vi9cD_P3Gr-OiwPw9Aw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2023-07-13 15:52:32 | Re: Can we set time exception? |
| Previous Message | Voillequin, Jean-Marc | 2023-07-13 15:11:15 | RE: Can we set time exception? |