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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: 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-13 02:16:09
Message-ID: 93702.1760321769@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rob Sargent <robjsargent(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2025-10-13 08:47:22 Re: Option on `postgres` CLI to shutdown when there are no more active connections?
Previous Message Rob Sargent 2025-10-13 02:00:46 Re: Option on `postgres` CLI to shutdown when there are no more active connections?