Re: Non-text mode for pg_dumpall

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>
Cc: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, Vaibhav Dalvi <vaibhav(dot)dalvi(at)enterprisedb(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Non-text mode for pg_dumpall
Date: 2026-02-23 20:34:36
Message-ID: 7faf3a59-cfe1-45cb-a972-55e05560b414@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-02-23 Mo 3:58 AM, Mahendra Singh Thalor wrote:
> On Mon, 23 Feb 2026 at 13:35, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>> On Sun, Feb 22, 2026 at 1:05 AM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>> What about options like these?:
>>>
>>> n/--schema
>>> N/--exclude-schema
>>> t/--table
>>> T/--trigger
>>> I/--index
>>> P/--function
>>> -filter
>>>
>>> We're not currently doing anything about those, but do they make sense when restoring a pg_dumpall archive?
> We can keep these. If we use these options, then all databases will be
> created(CREATE DATABASE) and based on n/N/t/T options, objects will be
> restored.
> Let say customers want to restore tables tb1, tb2, tb5 from the
> cluster so only these tables will be restored even if they belong to
> different-different databases.

OK, I left that alone. We can revisit later if it bothers anyone.

>
>> We should reject these options too, since these options do not make
>> sense for multiple databases, IMHO.
>>
>>> pg_restore --clean --format=directory will produce DROP DATABASE will
>>> process global objects,
>>> it will also produce DROP DATABASE when processing each individual database.
>>> To prevent errors during a subsequent restore, we can require
>>> pg_restore --clean option must be used together with --if-exists when
>>> restoring a non-plain-text dump.
>>>
>>> We could. Or we could just turn it on (and document that it will be turned on) in this case. I'd rather not force people to use lots of flags.
>>>
>> Turning it on is OK for me.
>>
>> The attached patch addresses the two issues described above.
>>
>>

OK, here is my commit candidate patch.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
v19-0001-Add-non-text-output-formats-to-pg_dumpall.patch text/x-patch 111.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-23 21:00:20 Re: [PATCH] Support reading large objects with pg_read_all_data
Previous Message Bryan Green 2026-02-23 20:32:55 Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)