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 1v8Le2-00GiqQ-P8 for pgsql-general@arkaria.postgresql.org; Mon, 13 Oct 2025 16:43:34 +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 1v8Ldy-00721s-UO for pgsql-general@arkaria.postgresql.org; Mon, 13 Oct 2025 16:43:31 +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 1v8Ldy-00721k-Jc for pgsql-general@lists.postgresql.org; Mon, 13 Oct 2025 16:43:31 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v8Ldx-001xlr-0J for pgsql-general@lists.postgresql.org; Mon, 13 Oct 2025 16:43:30 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-3627a1979a0so3116066fac.1 for ; Mon, 13 Oct 2025 09:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760373807; x=1760978607; 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=j7yRg+vc3g/vphycBawMLg5RnIa/daCNJqa/qT6H4j4=; b=E7v3nY/viCU+QX6mePRF5nXX/blzTGVg9rf4inHgPMACdSmJYbRkCboSFESuXPC5nQ nWl+y7eRZmBh8ebuRquY/EjcRiZyb8paBe4XIFc5R+0oAlctkSInTQFmls0YMPhez3ke 1738pBfuPKbS0L2oYfzI/4dSowVRtmp9cPGsM+ASa2q45n+yZdKhyzgVeclzaTHsHM7E XYlf4diJlzCRnhY6V9O5TNDAV4Qsa1bBBX4z+u4eGOBexk8hgnGebd6O8jq2Or49xJRQ uBgCHs6I8otgIsGZiJ+k5Tik/WKadEMVQ3gJvZUGKYNrhNqJKgXTTqqIb2zj/tbujkd1 kzkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760373807; x=1760978607; 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=j7yRg+vc3g/vphycBawMLg5RnIa/daCNJqa/qT6H4j4=; b=N8/te9RQWNZ2blxk334iohS6D6+Vq81A2ZTjJahqYLSRsTA5vA3pDZx+RTKnaTHrRA h5YbmeDCE+pkplNUrqMG37kdPdLYBfsV35JFASit94cFyVdbO55era1lV/TmOjrC/a7E OddYwWkp0bho2r4tU7Fo2aALs/OjPBc58Zy2efDT2m/EGhAOxVfpyD+Cpcc46EOjl5at sS/A7nYMB8YTa168xRyqWOSyyPOUSjJYgxD7nv8zzAz8QxOmzsTB9kCxe90LM57YjDUe La7dmCLSETFPDXMyoc/JdLXx5jUuJDiTy+aGr5vwX+/ccnpLG9WHoyiVHeEneywLebjq Pf9Q== X-Forwarded-Encrypted: i=1; AJvYcCVMPl7sXUjQMQWjqK1G4OBHHCw88n9h+XLeHFv2w3tMZgJfu4LN36/nuezS1n1b5wSo6A+aTyNgT3zI/vZP@lists.postgresql.org X-Gm-Message-State: AOJu0YygMImTCiX4k7cMYAr2pYblz8asi2ZAAXNWYP4o/rBedNE/GwSw J6qA//I6XC9YtodzO86gGLLbStQGEzkndoOhON7xfBhAWss9l5YVhrkvspMZOf/a761iQCAumhx /XG5eYWiIYoHiWdDNGGb3+KinownMO7A= X-Gm-Gg: ASbGncsYRTH6kqyJLrNyI957D8fuq3OzgCgN32KUw0uSZLjKDrtPFpOpwuaQMT5xGy8 svw3LvRjO3CPH+ve5vt4K7cjSQchRnyms6G3SmDuovTuzOr/dZ8dEdeaMq2ATwMSgFCZTtnjJOy Dl4D8qHB24SdnthlknCMlqbOZkUeCj6tduH6Y7YlWVh8o1QjxfxnZssy+Iekr2Fi3kUM7yq1LvW yslNvsu/9Ogo/nHigby4v7QzNrW X-Google-Smtp-Source: AGHT+IFS92Q4jIcrR5FCo3PY5g4FpcL7ADqMCVGwaRslmCF06Xgar6Pn5SJRHpmCA/UoNDh6rnLwIs9+KMlwA0tJdvA= X-Received: by 2002:a05:6871:287:b0:31d:6d47:c648 with SMTP id 586e51a60fabf-3c0f9e65891mr10988799fac.47.1760373806890; Mon, 13 Oct 2025 09:43:26 -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: <233155.1760369829@sss.pgh.pa.us> From: Dominique Devienne Date: Mon, 13 Oct 2025 18:43:15 +0200 X-Gm-Features: AS18NWBywFIMRgoRyQYIGBLVPG3QxPJ2hJFv5IR-TTwMYs7cCXNvB0CakVtsw-8 Message-ID: Subject: Re: Option on `postgres` CLI to shutdown when there are no more active connections? To: Tom Lane Cc: Ron Johnson , "pgsql-generallists.postgresql.org" 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 5:37=E2=80=AFPM Tom Lane wrote: > Dominique Devienne writes: > > On Mon, Oct 13, 2025 at 5:08=E2=80=AFPM Ron Johnson wrote: > >> Shared memory means that I can stomp all over you, and you can't stop = me. That's the antithesis of ACID. > > > SHM is how SQLite in WAL mode coordinates access to the same DB from > > several connections. So if it's good enough for SQLite, I don't see > > what it would be wrong for PostgreSQL too. > > SQLite has accepted the cost that comes with being embedded, which is > that application-side memory-stomping bugs can destroy the database. > Postgres is not willing to make that tradeoff. From a pure > developer's perspective, every time we got a bug report we'd have to > ask "did you observe this while running embedded?" and then demand a > repro that uses a non-embedded database. We are not going to help > application authors debug their own bugs, especially not when we have > no visibility into what those are. That's true for the embedded case, true. There are some of those, on the ML (custom SQLite-based forum in fact), but not that many in fact, far from it. So that concern does exist, but maybe not to the extent one fears. But not for the localhost case, which remains "client-server" (multi-process). And SHM is then one of the options for the "transport" between the libpq-based client, and the backends (running on localhost). Unix Socket on Linux is almost perfect for the localhost case, but again, is not portable. And I'd need simplified authN, on the fly start if necessary, that kind of thing. Our apps are multi-process themselves too, and each process can also be multi-connection. In the localhost case, the data is private to you, but can still be accessed concurrently across connections (from one or more processes). And in that case, we shouldn't have to deal with passwords, and everything should run as the OS user. > > SQLite is also ACID. > > I guess they have a different set of assumptions about what that > buzzword means. As you wrote, there are existing footguns one can turn on to weaken ACID already. PostgreSQL is superior to SQLite in many ways. I get that the embedded use-case is a step too far, for a long time, but the localhost case, for testing but also for localhost private-data serving (a possibly cache of a larger remote server) is much more attainable. And valuable IMHO.