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 1v9cTc-003hNt-BT for pgsql-general@arkaria.postgresql.org; Fri, 17 Oct 2025 04:54:03 +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 1v9cTb-00HQ5o-AA for pgsql-general@arkaria.postgresql.org; Fri, 17 Oct 2025 04:54:02 +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 1v9cTa-00HQ5a-Vg for pgsql-general@lists.postgresql.org; Fri, 17 Oct 2025 04:54:02 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9cTX-002eSD-2r for pgsql-general@lists.postgresql.org; Fri, 17 Oct 2025 04:54:01 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-394587df7c4so626195fac.2 for ; Thu, 16 Oct 2025 21:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760676838; x=1761281638; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=GQhIbYFPz6beJM4nZ3Aha21sXV4A1rpCTMGQdUA2hDw=; b=bYhA4x6KENoiOYgRbS/qR9c6ifIZezxY4KYqpV9c1XBXHu6xg+JPHtTjLxkcv4fUw+ O4+PBpJXLZuYOhi48N+ErWDXr+srGk0BF24PFgmkLqWqpMcOXAerUPMT9qhNQVtAUW+3 8LT+dNUmjRRMRtY/ia+1UfR3HQ9/LVzUoonD+uO/MKcu+Rx2A4G77QxEIQ8R/xTJETAw XSVoYUS6PgnbRsjF423frawZ75p9p+K7keW6kBf3Zam51JZF0+QQpQrDerFQVNhnB0jx jFMNWoTl6RCjzCPMJiVJS8x0VQOf5oe/YRNJIXK9jcRQpqYRLDa552B5BA5o9VajjjYT dJcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760676838; x=1761281638; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GQhIbYFPz6beJM4nZ3Aha21sXV4A1rpCTMGQdUA2hDw=; b=mnrW4+KuQi3eYin54/Pd3ll7QtPwDI2+Nlcz+lKl/Foj/m7lACC+WLuSDLpLnC8SQA fxGGOztBtsDyBvd8uJrF6hPIoLzXL2TRsgQM+ZyqQyaisgl2zds2spkpCd/8WRzlVwZm KufLBlAQYsd0loXNfcuVceBzLGA0s9DchxBJhpvaTapAS07LtNA8yx0H/qV8qAvJCHsr Nsf0PtukrIA+nbOFGvXgIR1cyWm6f5DbQYKoW7+n9BcGFvfHfw99jFoi6kz2axulMsFP vCA50lCvKxl17nk1d7WzMwHuhEE/RJuEB5DA1eNDdPcR0t0tSOTfp6z/mhXlB2YGALnw xSBQ== X-Gm-Message-State: AOJu0YyvrDrw3iBsTU0G3eL7Z5Nd2dMkZ3BMIgx7Y4nqQ56EH2ImV9ww Z9tZdr+YpjQTvjWjzKxBbik6n1L/TsmQz+3e2JMPbc27aNy6m0pk/020jwc9RTyzKFgP5wGfstB HObAcKEp0BzWK0XUtW7nX84XUGm7Z7Rx+XQ== X-Gm-Gg: ASbGncsXEsFb8bsI0FA+rv/rVwd6NPqRbpwYc1uV+7fvO5MgRVegwgi92m0KUngYDtB LKSgtxzTul9UV8ZAirwvg2sKDI0nbOmXJO/ny7HGc4i/BAktR0lmGGuhXYzD3HB38/z5j38QGq2 bvstr4z3QOoEOy2lbET6DyAaFTyHd2GCLMJ8Xv0BSJsp3tt08vWYFOCz4G5f8RrR+ZtTNd0lZjy NhFDLmkbp+IJRz/zwWZSkziZettlCtaWBE97i7AfOqh8IGhQZdrhyCLmdvYVA== X-Google-Smtp-Source: AGHT+IEpSg+OgqvzbnFlcjltIpYnjoGOAuGbSeQDZv4ENHg8fcphqRJGPEPrx6VA8knScpmb4CwXYgqABEB73uuf5NM= X-Received: by 2002:a05:6871:eb09:b0:380:527e:50b2 with SMTP id 586e51a60fabf-3c98cf93d74mr769042fac.18.1760676837770; Thu, 16 Oct 2025 21:53:57 -0700 (PDT) MIME-Version: 1.0 References: <73ff46d2-0bad-4a8d-9928-e494c2d5b0d1@gmail.com> <93702.1760321769@sss.pgh.pa.us> <233155.1760369829@sss.pgh.pa.us> <1570124.1760653327@sss.pgh.pa.us> In-Reply-To: <1570124.1760653327@sss.pgh.pa.us> From: Ron Johnson Date: Fri, 17 Oct 2025 00:53:45 -0400 X-Gm-Features: AS18NWB92XV8VZ7UcLn8nBBPGJUEwIlN1wfPZUY7Dolal3eXt2eQOwWgcUDlaZk Message-ID: Subject: Re: Option on `postgres` CLI to shutdown when there are no more active connections? To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000007ac99c0641538514" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007ac99c0641538514 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 16, 2025 at 6:22=E2=80=AFPM Tom Lane wrote: > Greg Sabino Mullane writes: > > On Mon, Oct 13, 2025 at 3:19=E2=80=AFPM David Barsky wrote: > >> Anyways, I'll try to get at what motivated this whole discussion: woul= d > >> there be community opposition to adding a CLI flag that'd exit/shutdow= n > all > >> Postgres processes once all pending connections close? > > > I don't know about opposition, per se, but the onus is on you to provid= e > a > > strong use case not already covered by existing tools. > > In particular, it's not terribly clear why the existing "smart" > shutdown mode isn't sufficient. > I think OP is saying "we don't run the tests from a shell prompt, so can't run pg_ctl stop". I think he might be able to, though, by having his IDE run a PowerShell command that runs "pg_ctl stop -wt9999", and also create an error trap that also runs that PS command. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000007ac99c0641538514 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Oct 16, 2025 at 6:22=E2=80=AFPM T= om Lane <tgl@sss.pgh.pa.us> = wrote:
Greg Sabino Mullane <htamfids@gmail.com> writes:=
> On Mon, Oct 13, 2025 at 3:19=E2=80=AFPM David Barsky <me@davidbarsky.com> wrote= :
>> Anyways, I'll try to get at what motivated this whole discussi= on: would
>> there be community opposition to adding a CLI flag that'd exit= /shutdown all
>> Postgres processes once all pending connections close?

> I don't know about opposition, per se, but the onus is on you to p= rovide a
> strong use case not already covered by existing tools.

In particular, it's not terribly clear why the existing "smart&quo= t;
shutdown mode isn't sufficient.
<= br>
I think OP is saying "we don't run the tests from a = shell prompt, so can't run pg_ctl stop".

= I think he might be able to, though, by having his IDE run a PowerShell com= mand that runs "pg_ctl stop -wt9999", and also create an error tr= ap that also runs that PS command.

--
Death to <Redacted>, and butter sauce.
Don'= t boil me, I'm still alive.
<Redacted> lobster!
--0000000000007ac99c0641538514--