Re: Non-text mode for pg_dumpall

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>
Cc: Srinath Reddy <srinath2133(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Non-text mode for pg_dumpall
Date: 2025-02-12 07:14:34
Message-ID: CACJufxH3T9OFg53HDXydLCKgHFVqAmbOu_huJpitVtggdP31fw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 12, 2025 at 1:17 AM Mahendra Singh Thalor
<mahi6run(at)gmail(dot)com> wrote:
>
> >
> > There are some tests per https://commitfest.postgresql.org/52/5495, I
> > will check it later.

hi.
the cfbot failure is related to function _tocEntryRequired

if (strcmp(te->desc, "DATABASE") == 0 ||
strcmp(te->desc, "DATABASE PROPERTIES") == 0)
{
- if (ropt->createDB)
+ if (ropt->createDB || AH->format != archNull)
return REQ_SCHEMA;
else
return 0;

for restoring multiple databases:
in v16 implementation: pg_restore even if you do not specify --create,
it actually did what pg_restore --create option does.

if there are multiple databases in the archive:
to make the pg_restore --file output is usable, the output file need
have \connect and CREATE DATABASE
command. that is exactly what --create option would do.
pg_restore --file behavior need align with pg_restore --dbname.
therefore pg_restore restoring multiple databases will use --create option.

we can either error out (pg_fatal) saying
restoring multiple databases requires the pg_restore --create option.
Or we can add a pg_log_info saying
pg_restore --create option will be set to true while restoring
multiple databases.

for restoring one database, the master behavior is fine.
so we don't need to change _tocEntryRequired.

Attachment Content-Type Size
v16_misc.nocfbot application/octet-stream 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-02-12 07:23:39 Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible
Previous Message John Naylor 2025-02-12 06:48:35 Re: Fix punctuation errors in PostgreSQL documentation