public inbox for [email protected]  
help / color / mirror / Atom feed
pg_dumpall bug exit code 0 with fatal
2+ messages / 2 participants
[nested] [flat]

* pg_dumpall bug exit code 0 with fatal
@ 2026-04-23 15:17 Владимир Фролов <[email protected]>
  2026-04-23 21:42 ` Re: pg_dumpall bug exit code 0 with fatal Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Владимир Фролов @ 2026-04-23 15:17 UTC (permalink / raw)
  To: [email protected]

 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: PQgetResult()
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!  In my backup script tell OK to this
task. Monitoring tell ok, but backup is empty (


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_dumpall bug exit code 0 with fatal
  2026-04-23 15:17 pg_dumpall bug exit code 0 with fatal Владимир Фролов <[email protected]>
@ 2026-04-23 21:42 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-04-23 21:42 UTC (permalink / raw)
  To: Владимир Фролов <[email protected]>; +Cc: [email protected]

=?UTF-8?B?0JLQu9Cw0LTQuNC80LjRgCDQpNGA0L7Qu9C+0LI=?= <[email protected]> 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: PQgetResult()
> 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 = runPgDump(dbname, create_opts);
        if (ret != 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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-04-23 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-23 15:17 pg_dumpall bug exit code 0 with fatal Владимир Фролов <[email protected]>
2026-04-23 21:42 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox