Re: Option on `postgres` CLI to shutdown when there are no more active connections?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Option on `postgres` CLI to shutdown when there are no more active connections?
Date: 2025-10-17 04:53:45
Message-ID: CANzqJaAS_2XR=92GDdLA_ASDsQ+6_kz3Eju_5ESoiaDw3ZSokw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 16, 2025 at 6:22 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Greg Sabino Mullane <htamfids(at)gmail(dot)com> writes:
> > On Mon, Oct 13, 2025 at 3:19 PM David Barsky <me(at)davidbarsky(dot)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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chanukya SDS 2025-10-17 05:53:47 pg_running_stats - mergeable running statistics (Welford/Chan) extension for postgresql
Previous Message Ron Johnson 2025-10-17 04:49:06 Re: Enquiry about TDE with PgSQL