Re: Option on `postgres` CLI to shutdown when there are no more active connections?
Ron Johnson <ronljohnsonjr@gmail.com>
From: Ron Johnson <ronljohnsonjr@gmail.com>
To: "pgsql-generallists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2025-10-17T04:53:45Z
Lists: pgsql-general
On Thu, Oct 16, 2025 at 6:22 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Greg Sabino Mullane <htamfids@gmail.com> writes: > > On Mon, Oct 13, 2025 at 3:19 PM David Barsky <me@davidbarsky.com> wrote: > >> Anyways, I'll try to get at what motivated this whole discussion: 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 provide > 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. -- Death to <Redacted>, and butter sauce. Don't boil me, I'm still alive. <Redacted> lobster!