Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPnQM-006MhH-U8 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 18:12:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sPnQK-00CRyw-Mo for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 18:12:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPnQK-00CRyo-8I for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 18:12:45 +0000 Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPnQI-000atI-NI for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 18:12:44 +0000 Received: by mail-vs1-xe2f.google.com with SMTP id ada2fe7eead31-48f96299087so116308137.0 for ; Fri, 05 Jul 2024 11:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seawardmoon.com; s=google; t=1720203159; x=1720807959; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=QqHtUKBnBTLU5F9EJJaaCwEfi9fjCslVqp6ZDmt7TJU=; b=hGy6V22uGm08ZqQVEaSez88vA6rqVhKxXW85ic0m3gLfksMjmfr1au53B44hSwR5zl eeSctcotwJzb+QJ3hm9l4rHgwuHvoApnpNgRYhVmbBVhDCpRJm9A40UaLVONaliMb1rf PGIFTYR1ozY5WOG1/dCoz6WssChTQOZnGJGVVf+8KeI58+MpG6EfWF0zK6+J8zd2l2ke n2f1a6U3eiO6bcWwbfypO8iCNLIl4lb1pN7ZI45SyEq1Xbb5t552mH6daFRiw1YByn3R uEU2FMjUEkTUF0bV6+mKagq7nOGBdzF+vd6riwQzOnjfTJ6vwewmHadzRV/09vk9KbN9 8L9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720203159; x=1720807959; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QqHtUKBnBTLU5F9EJJaaCwEfi9fjCslVqp6ZDmt7TJU=; b=VRPz+z/5/x3pCvv9xfoMiJnHQ3F6Wgw9rHJfdt05nGj95MdU8Q7sP3tnXWtk54UFLa XJdAdIvINeU6qvZpv7kiyiphax9mbkP5Fe74cGMeBQLNmLKzsOp9X2C8IoYPNZxXYXNb 5FTK8O/qmvQYbtL1Ol8AqJMnwvdbLpF5ivPzzJSyrFxKu0R7xYHlpdtnECD71qUMtta+ 294zMEm4D1LX9RLs4SIH6NRK7Ynlpe13Py6XcqLQM3vxdadkXcxTxWqVmZHhBhmvFQ2b +h8JqYIUTvU5fD2FygINt+iHAiV3BYoTNd9EO2l1X+gWYLQG8vfiynA2OSZRl3JPvz3Y Jibg== X-Gm-Message-State: AOJu0YxrvD89dR3OWYlai1wA2qtv97uXgSKXFXXzHj5jDp5Nbumy28Dd HHff7lW6kdRsdkl7mZEoXdgxTkYa/JPEqCPmuUvZ+lr/SkHUQJ1U2f9EA56yOeTneOaMjTapJgC qLEs+5WkgtxDC3QwaDWls3IgiLyA1k4nnt+YsEzvmytjgkPer X-Google-Smtp-Source: AGHT+IEBRFSZ4ewHLmMOJLpXhacYK/9zSUhu+vYCsDKbWnUl8ZzAUqgmFbSzRN4CelffVlRUtLHz5+HY88fqkgdpU58= X-Received: by 2002:a05:6102:2927:b0:48f:e2bb:3e2e with SMTP id ada2fe7eead31-48fee5554a3mr5489025137.0.1720203159264; Fri, 05 Jul 2024 11:12:39 -0700 (PDT) MIME-Version: 1.0 From: Dennis White Date: Fri, 5 Jul 2024 14:12:27 -0400 Message-ID: Subject: Can a long running procedure detect when smart shutdown is pending? To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000003ffcad061c8402c0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003ffcad061c8402c0 Content-Type: text/plain; charset="UTF-8" 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 --0000000000003ffcad061c8402c0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 frien= dly so it can stop between steps?

We are using bot= h 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 w= ithin the procedure to determine a shutdown is pending?

Thanks,
Dennis
--0000000000003ffcad061c8402c0--