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.96) (envelope-from ) id 1wG1ox-005oMg-39 for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 21:42:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wG1ow-003JPS-0R for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 21:42:50 +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.96) (envelope-from ) id 1wG1ov-003JPK-2r for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 21:42:49 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wG1ot-00000002ijW-1Yji for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 21:42:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 63NLghrs1498864; Thu, 23 Apr 2026 17:42:43 -0400 From: Tom Lane To: =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQpNGA0L7Qu9C+0LI=?= cc: pgsql-bugs@lists.postgresql.org Subject: Re: pg_dumpall bug exit code 0 with fatal In-reply-to: References: Comments: In-reply-to =?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQpNGA0L7Qu9C+0LI=?= message dated "Thu, 23 Apr 2026 18:17:32 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1498862.1776980563.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Apr 2026 17:42:43 -0400 Message-ID: <1498863.1776980563@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQpNGA0L7Qu9C+0LI=3D?=3D writes: > I have installed two nodes cluster- PostgreSQL 16.3 (Debian > 16.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian > 12.2.0-14) 12.2.0, 64-bit with wal logical replication. When i run > pgdump_all - i have error - > pg_dump: error: Dumping the contents of table "*****" failed: PQgetResul= t() > failed. > pg_dump: detail: Error message from server: ERROR: canceling statement = due > to conflict with recovery > DETAIL: User query might have needed to see row versions that must be > removed. > pg_dump: detail: Command was: COPY **** ( **** ) TO stdout; > pg_dumpall: error: pg_dump failed on database "**********", exiting > it is normal, BUT! exit code is 0! That's pretty hard to believe. pg_dumpall emits that message only here: ret =3D runPgDump(dbname, create_opts); if (ret !=3D 0) pg_fatal("pg_dump failed on database \"%s\", exiting", dbname)= ; and pg_fatal is defined here (logging.h): /* * A common shortcut: pg_log_error() and immediately exit(1). */ #define pg_fatal(...) do { \ pg_log_generic(PG_LOG_ERROR, PG_LOG_PRIMARY, __VA_ARGS__); \ exit(1); \ } while(0) So the exit code definitely should have been 1. Maybe you have some kind of wrapper around pg_dumpall that is failing to pass the exit code through correctly? regards, tom lane