should pg_dumpall --clean apply to database in --exclude-database

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: should pg_dumpall --clean apply to database in --exclude-database
Date: 2026-10-06 05:40:23
Message-ID: CACJufxH8tDcuj+UP3qzNV-vYOtQL4-pUQDMF6cEMvstRfSHMPg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

https://www.postgresql.org/docs/devel/app-pg-dumpall.html
--clean options says
"""
Emit SQL commands to DROP all the dumped databases, roles, and
tablespaces before recreating them.
"""

Currently, with --clean, pg_dumpall still emits a DROP DATABASE
command for databases excluded with --exclude-database.
It is not clear to me whether --clean is meant to apply to excluded databases.

Let's see how --clean and --exclude-table work.
If I say
--clean --exclude-table=onek2
then no SQL command ``DROP TABLE public.onek2``.

--
jian
https://www.enterprisedb.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ZizhuanLiu X-MAN 2026-10-06 05:40:29 Re: Optimize MCV stats for sortable types and utilize sorted-order properties
Previous Message JoongHyuk Shin 2026-10-06 05:04:58 Re: [PATCH] Extend MXactCache lifetime from per-transaction to per-session