Re: [Patch] Don't stop a `vacuumdb --all` on a connection failure

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>
Cc: Christophe Pettus <xof(at)thebuild(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Patch] Don't stop a `vacuumdb --all` on a connection failure
Date: 2026-07-29 10:28:22
Message-ID: E0B74712-5D79-422F-8AA7-33122DA98B8C@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 29 Jul 2026, at 05:45, Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com> wrote:

> 1. reindexdb and clusterdb appear to have the same problem — they also
> abort on an unconnectable database. Should we apply the same fix to those
> tools as well? Or is there a reason they should behave differently from vacuumdb?

It seems reasonable to make them all work the same. (I didn't read the patch
so might be missing some technical reasoning.)

> 2. vacuumdb --all now exits 0 even when some databases were skipped.
> Scripts that rely on exit codes to detect failures would silently miss skipped databases.
> Might be worth considering whether the exit code should reflect that not all databases were processed.

While I agree that avoiding a new switch would be good, for this reason alone I
think we should consider adding a --continue to trigger the skipping behaviour
and keep --all with the current exit code handling. If we allow skipping then
we really can't return anything other 0 even if we skip all databases.

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilmar Yunusov 2026-07-29 10:30:40 Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation
Previous Message Amit Kapila 2026-07-29 10:21:06 Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation