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 1v886h-00DE0t-DI for pgsql-general@arkaria.postgresql.org; Mon, 13 Oct 2025 02:16:15 +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 1v886f-003ZFR-0m for pgsql-general@arkaria.postgresql.org; Mon, 13 Oct 2025 02:16:13 +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 1v886e-003ZFD-MR for pgsql-general@lists.postgresql.org; Mon, 13 Oct 2025 02:16:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v886d-001qYl-1b for pgsql-general@lists.postgresql.org; Mon, 13 Oct 2025 02:16:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 59D2G9Uo093703; Sun, 12 Oct 2025 22:16:09 -0400 From: Tom Lane To: Rob Sargent cc: pgsql-general@lists.postgresql.org Subject: Re: Option on `postgres` CLI to shutdown when there are no more active connections? In-reply-to: <73ff46d2-0bad-4a8d-9928-e494c2d5b0d1@gmail.com> References: <73ff46d2-0bad-4a8d-9928-e494c2d5b0d1@gmail.com> Comments: In-reply-to Rob Sargent message dated "Sun, 12 Oct 2025 20:00:46 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <93701.1760321769.1@sss.pgh.pa.us> Date: Sun, 12 Oct 2025 22:16:09 -0400 Message-ID: <93702.1760321769@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rob Sargent writes: > On 10/12/25 16:10, David Barsky wrote: >>> Postgres is not an embedded database, if you want that experience then >>> use a database that is designed to be embedded. >> That's fair, especially from an operational standpoint. However, I _think_ >> Postgres can get really close to an embedded database's development >> experience >> by doing a few tricks that I'll elaborate on later on in this email. > Were I a betting man, I would bet heavily against this community, which > prides itself on NOT losing data, allowing an option that would do just > that. Well, mumble ... we have any number of options that can be read that way. One obvious one is that we don't try to prevent you from putting $PGDATA on a RAM disk. Turning off fsync is another popular way to trade away durability for speed. But I concur with the point that we're not here to pretend to be an embedded database, as there are other projects that do that better (for example, our good friends at SQLite). The advice I'd give the OP is to take a look at our TAP-test infrastructure. We've put a good deal of effort, and are continuing to do so, into letting those tests spin up transitory testing databases pretty cheaply. regards, tom lane