public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Shaozhong SHI <[email protected]>
Cc: pgsql-sql <[email protected]>
Subject: Re: Can we set time exception?
Date: Thu, 13 Jul 2023 08:36:48 -0700
Message-ID: <CAKFQuwYVJpjs0Z-Fy3kbUYbg5tFWEK8Vi9cD_P3Gr-OiwPw9Aw@mail.gmail.com> (raw)
In-Reply-To: <CA+i5Jwb3MGNSrMFeNSg1FOW+JjHi5vSGRaYaW1A-BHCzGuPNWA@mail.gmail.com>
References: <CA+i5Jwb3MGNSrMFeNSg1FOW+JjHi5vSGRaYaW1A-BHCzGuPNWA@mail.gmail.com>

On Thu, Jul 13, 2023 at 7:46 AM Shaozhong SHI <[email protected]>
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.


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Can we set time exception?
  In-Reply-To: <CAKFQuwYVJpjs0Z-Fy3kbUYbg5tFWEK8Vi9cD_P3Gr-OiwPw9Aw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox