BUG #16981: pg_dump errors out with incompatible option set but empty tar dump file is created as result - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16981: pg_dump errors out with incompatible option set but empty tar dump file is created as result
Date
Msg-id 16981-df7cf847e31caada@postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16981
Logged by:          Edwin Polkerman
Email address:      edwin.polkerman@splendiddata.com
PostgreSQL version: 13.2
Operating system:   Centos7/8, RHEL7/8, SUSE12/15
Description:

Basically it is more an improvement than a real bug
Run the following pg_dump command:

> pg_dump -h 10.17.0.12 -p 5432 -d postgres -U splendid -f
/home/splendid/pg_dump_file.tar -F t -v --compress=4

As expected pg_dump returns an error:
pg_dump: error: compression is not supported by tar archive format

What was not expected is that the file pg_dump_file.tar is created (with 0
size)
> ls -l /home/splendid
-rw-rw-r-- 1 splendid splendid 0 Apr 23 12:50 pg_dump_file.tar

To my opinion the dump file should not be created because the check on
options provided can be done before creating the result file


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16980: invalid memory alloc request size
Next
From: PG Bug reporting form
Date:
Subject: BUG #16982: pg_rewind cannot deal with configuration files (postgresql.conf) located outside data directory