Hi Manu
Thank you for the comments.
I registered this to CF https://commitfest.postgresql.org/patch/7407/ .
> I looked into this as well, and the patch matches what I see.
I checked the almost same thing as you did. Thank you for the confirmation.
>
> Two small things:
>
> - With restart_after_crash off, the server does not stay down passively:
> it logs 'shutting down because "restart_after_crash" is off' and shuts
> the whole cluster down, so a manual restart is needed. The patch gives
> the "on" case; it might be worth saying what "off" does too.
>
> - A little further down, this same section recommends protecting the
> postmaster with a low oom_score_adj so the OOM killer picks a child.
> With that in place the victim is a backend -- your "another server
> process" case -- while "the postmaster is terminated" is mostly what
> happens without that protection. Relating the two might help the
> reader, though it may be more than this fix intends.
Both of the points make sense. I added them in v2 patch.
Regards,
Takeshi Ideriha
From 5ad0f40766634d4d7a728cb67d0833e8184b3467 Mon Sep 17 00:00:00 2001
From: Takeshi Ideriha <[email protected]>
Date: Thu, 8 Oct 2026 10:40:20 +0900
Subject: [PATCH v2] Fix explain how postgres behaves when an OOM killer is
invoked.
---
doc/src/sgml/runtime.sgml | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index d9984910cc4..2cb5b3844c7 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -1359,9 +1359,17 @@ Out of Memory: Killed process 12345 (postgres).
</programlisting>
This indicates that the <filename>postgres</filename> process
has been terminated due to memory pressure.
- Although existing database connections will continue to function
- normally, no new connections will be accepted. To recover,
- <productname>PostgreSQL</productname> will need to be restarted.
+ If the postmaster is terminated, all connections will eventually be
+ terminated. To recover, <productname>PostgreSQL</productname> will
+ need to be restarted. To reduce this risk, the OOM score adjustment of the
+ postmaster can be set lower than that of its child processes, as described
+ later in this section.
+ If a child process is terminated, all connections
+ will be terminated and <productname>PostgreSQL</productname> will
+ automatically restart when
+ <link
linkend="guc-restart-after-crash"><varname>restart_after_crash</varname></link>
+ is on. If it is off, <productname>PostgreSQL</productname> will stop and
+ must be restarted manually.
</para>
<para>
--
2.50.1 (Apple Git-155)