Why pg_dump overwrites dump file?

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Why pg_dump overwrites dump file?
Date: 2025-10-14 05:42:22
Message-ID: 534AA60D-CF6B-432F-9882-E9737B33D1B7@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hacker,

I noticed this problem while testing the other patch.

When I do custom-format dump, if a target file exists, pg_dump will just go ahead overwrite the existing file; however, when I do directory dump, if a target dir exists, pg_dump will fail with an error “directory xxx is not empty”.

Behaviors of the two types of pg_dump are inconsistent, I wonder if that’s by design?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-10-14 05:44:25 Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Previous Message Michael Paquier 2025-10-14 05:40:59 Re: Add LZ4 compression in pg_dump