public inbox for [email protected]  
help / color / mirror / Atom feed
From: Voillequin, Jean-Marc <[email protected]>
To: Shaozhong SHI <[email protected]>
To: pgsql-sql <[email protected]>
Subject: RE: Can we set time exception?
Date: Thu, 13 Jul 2023 15:11:15 +0000
Message-ID: <MN2PR20MB27351E99A6CA27168B56A478BE37A@MN2PR20MB2735.namprd20.prod.outlook.com> (raw)
In-Reply-To: <CA+i5Jwb3MGNSrMFeNSg1FOW+JjHi5vSGRaYaW1A-BHCzGuPNWA@mail.gmail.com>
References: <CA+i5Jwb3MGNSrMFeNSg1FOW+JjHi5vSGRaYaW1A-BHCzGuPNWA@mail.gmail.com>

create or replace function shi() returns text as $$
declare
ts timestamp:=clock_timestamp();
begin
               perform pg_sleep(2);
               if extract ('epoch' from age(clock_timestamp(),ts))>2 then
                              return 'timeout';
               else
                              return 'ok';
               end if;
end;$$ language plpgsql;

From: Shaozhong SHI <[email protected]>
Sent: Thursday, July 13, 2023 4:46 PM
To: pgsql-sql <[email protected]>
Subject: Can we set time exception?

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. Regards, David ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
ZjQcmQRYFpfptBannerStart
This email originated from outside of Moody's
Do not click links or open attachments unless you recognize the sender and know the content is safe.
ZjQcmQRYFpfptBannerEnd
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.

Regards,

David

----------------------------------------------------------------------
Moody's monitors email communications through its networks for regulatory compliance purposes and to protect its customers, employees and business and where allowed to do so by applicable law. The information contained in this e-mail message, and any attachment thereto, is confidential and may not be disclosed without our express permission. If you are not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution or copying of this message, or any attachment thereto, in whole or in part, is strictly prohibited. If you have received this message in error, please immediately notify us by telephone, fax or e-mail and delete the message and all of its attachments. Every effort is made to keep our network free from viruses. You should, however, review this e-mail message, as well as any attachment thereto, for viruses. We take no responsibility and have no liability for any computer virus which may be transferred via this e-mail message.


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: <MN2PR20MB27351E99A6CA27168B56A478BE37A@MN2PR20MB2735.namprd20.prod.outlook.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