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 1v8yAg-007wJj-Jf for pgsql-general@arkaria.postgresql.org; Wed, 15 Oct 2025 09:51:49 +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 1v8yAf-005dGM-DD for pgsql-general@arkaria.postgresql.org; Wed, 15 Oct 2025 09:51:48 +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 1v8yAf-005dGC-2L for pgsql-general@lists.postgresql.org; Wed, 15 Oct 2025 09:51:48 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v8yAb-002IYR-2e for pgsql-general@lists.postgresql.org; Wed, 15 Oct 2025 09:51:47 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-64a6cff75e9so1855986eaf.0 for ; Wed, 15 Oct 2025 02:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760521903; x=1761126703; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cctksT7mGa6C1jiwU7pk3Bx/fqXzUctf4/RFt/S+UN8=; b=BSNn3W5/4h27OcHeP3l3TUXsvachgqq4tusp040QDpxdj3zW3uopuJ40PcvUKNN5BF mn1j5xD+HP1V39qMOKsle072fdb/qypOPLQdXCBxH/IXQ4feJfk77tw+QWNh/R71NSou Qc9eO+qQOLgYmtUpLXUxSDLbIs5XIPv7rkgBIlyaaRkCYIGf+fv7o9xi0BDTUoc8B9gz 710frCvIskXtx659cFXAXbmMNaFYIEfT1350SUv4X3ZAm8QVFJmnoM0Bp/1ilBbn7HVl yIBSp3KwKpRVSNq1Bpl2NOXuj3aLm5pyUnIhaw2mtrGAFi4H/n2xcTdENQshdZKRv5iq nqug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760521903; x=1761126703; h=content-transfer-encoding:cc: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=cctksT7mGa6C1jiwU7pk3Bx/fqXzUctf4/RFt/S+UN8=; b=qRlasOBMp8iNUXGIBxOr8HfsdApWsjYP+HjPnwFDJJK5b86rtkAqkjgYkg+33OALZY 2YdDUkOVoTjYNpbsvFnqWGzgpYLLOPuXojeBS1PU1NbiB8zdggydvd7O+ynvE69zHDqo 9Kmr2HvDVJOWmpQoSYLFF7Tra0WEcv1jIQ4V0nIsWm4BUoDmMaD7XNAX8diwj+qCt45H QuCqdk7P921xS0Dph6Zdf+XShe/MuhFhbT5VTN2vVwhyTp4HqOWS3QuROsPzZquUhWRr ccBN3ZiEZQSqrcN3aEn88ZUrOUSwdTXXzLG9sAMh37iV+8j9cpS5TmLgU3kYWnS7UsSk lNhw== X-Forwarded-Encrypted: i=1; AJvYcCUngpTuQylDO5FLZl65aL85mCSzutcIfmscUtzJ7E94/CJ77CDOn0dKUDHg7Azm3wmBRO5AM2ZBceg3+qb9@lists.postgresql.org X-Gm-Message-State: AOJu0YwmS7vzveVFK8ZLzC4cgSOPup625gPyWVKso+5WwR/OdfYiDW1P PIYUss8eB/CCgaIJ+7Zf1D8ys4jdIeERkXQAkSbLS0CMYccAuUvAFqh2+DHzm+SF7G3pYj9TtO0 /1NjfjxQe4NfHeqKqavRhDDA+XU6MRxE= X-Gm-Gg: ASbGncsoteRBHOzrnyK24T3eqhpHy52nWpNJsTg9xOq+GQ/UjYWHXKe4shjLLeUHS3+ tuLnLUXgICTzmnEzI6IBQi22VEcyHN/zBbmtwjuz3KFwDJ86pFBAcgOFOTzxeDlfffdncusoSFJ VBuGk7MylFPIoQdKPtrK/4GbMUq+JA1muyBtSm0XtcTVgzuDVJOnjOgoCClt6oj6AMcv6aJrcsn 5M/Wi9QLsP9T0zNZNJCKlh0talo X-Google-Smtp-Source: AGHT+IEDjF1UoUcA8s/QdEB+wC+K3Og9SO2IAHpyY2Id1Pzrf0NDA/ikhNHfbjAvJifnTTJsd0yG3SmWAFDasS8gNIM= X-Received: by 2002:a05:6870:6493:b0:306:c53a:f904 with SMTP id 586e51a60fabf-3c0f51a45dbmr10091651fac.9.1760521903008; Wed, 15 Oct 2025 02:51:43 -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> In-Reply-To: From: Dominique Devienne Date: Wed, 15 Oct 2025 11:51:32 +0200 X-Gm-Features: AS18NWAvv42-id1wfXn45bJ3RqFmgvBqa3Tq8Pmj7IOe9_iqqW91LY3ooTYm5PM Message-ID: Subject: Re: Option on `postgres` CLI to shutdown when there are no more active connections? To: David Barsky Cc: Ron Johnson , "pgsql-generallists.postgresql.org" , Tom Lane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 13, 2025 at 9:19=E2=80=AFPM David Barsky w= rote: > > SQLite is fantastic, but it's type-system and lock-model are too restri= ctive, > > for a general DB. Similar to David, I think PostgreSQL is close to my i= deal > > above, yet still far-enough (and perhaps unwilling enough, as a communi= ty) > > to venture into embedded and localhost use-cases, that it's frustrating= . > > Yup, Dominique understands what I want: Postgres' type system, query plan= ner, > and locking model, but _shades_ of SQLite's operational properties during= local > development. However, I don't really need Postgres to function like an em= bedded > database; I just want the self-contained process cleanup. Connecting to P= ostgres > over TCP over localhost is perfect for my use-case Except postgres is actively hostile to localhost testing by not supporting ephemeral TCP ports... Why oh why??? My own servers are unit tested that way. Why would postgres.exe prevent the use of port 0? Any work-around that picks a "free" port is racy and ugly. There's a clean idiom for that, and that's port 0. Why disable it? I don't get it... --DD D:\pdgm\trunk\psc2\pgdata>where postgres.exe D:\pdgm\kits\trunk\postgresql\17.6\Win_x64_10_v17\bin\postgres.exe D:\pdgm\trunk\psc2\pgdata>where initdb.exe D:\pdgm\kits\trunk\postgresql\17.6\Win_x64_10_v17\bin\initdb.exe D:\pdgm\trunk\psc2\pgdata>initdb -D .\test1 -U postgres -A trust The files belonging to this database system will be owned by user "ddevienn= e". ... Success. You can now start the database server using: pg_ctl -D ^"^.^\test1^" -l logfile start D:\pdgm\trunk\psc2\pgdata>postgres -D .\test1 -p 0 2025-10-15 09:43:59.293 GMT [42288] FATAL: 0 is outside the valid range for parameter "port" (1 .. 65535)