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

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [Patch] Don't stop a `vacuumdb --all` on a connection failure
Date: 2026-07-27 20:30:13
Message-ID: B2981DA2-EA72-4768-8C38-89F65E2F16EB@thebuild.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently, `vacuumdb --all` returns FATAL and stops if it can't connect to one of the discovered databases. On some hosted providers (in particular, CloudSQL), there are reserved databases that the credentials supplied to the user can't connect to. This makes `vacuumdb --all` less than useful in those environments.

Attached is a patch that de-escalates the error so that vacuumdb continues if it can't connect to a database. It does mean that if the connection info is fundamentally wrong, or the instance is unreachable, the command doesn't error out immediately. I don't think there's anything particularly valuable about the current behavior, so it's a general change rather than yet another switch.

Attachment Content-Type Size
0001-vacuumdb-skip-unconnectable-databases.patch application/octet-stream 5.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-07-27 20:33:11 Re: timestamp vs. timestamptz comparisons inconsistently ordered under DST
Previous Message Laurenz Albe 2026-07-27 19:51:53 Re: timestamp vs. timestamptz comparisons inconsistently ordered under DST