Can a long running procedure detect when smart shutdown is pending?

From: Dennis White <dwhite(at)seawardmoon(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Can a long running procedure detect when smart shutdown is pending?
Date: 2024-07-05 18:12:27
Message-ID: CAE=rie-ZcNzzt_8bKrN-7fnnbYL-ofbne4jNurd3HjjW2j9Yaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

My project's DB has a mutli-step stored procedure using Transaction Control
that may take 30 minutes or more to complete.
I am curious if there is a way to make it more smart shutdown friendly so
it can stop between steps?

We are using both PG 14 and PG 16 on Rhel 8.
Pardon me if it's obvious but is there a function to call or a table that
could be checked after a commit within the procedure to determine a
shutdown is pending?

Thanks,
Dennis

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-07-05 18:22:08 Re: Removing the default grant of EXECUTE on functions/procedures to PUBLIC
Previous Message Tefft, Michael J 2024-07-05 17:42:35 RE: Removing the default grant of EXECUTE on functions/procedures to PUBLIC