Re: Refactor handling of database attributes between pg_dump and pg_dumpall

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Refactor handling of database attributes between pg_dump and pg_dumpall
Date: 2017-04-04 05:06:08
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Thu, Mar 30, 2017 at 12:00 PM, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>

> On Wed, Mar 29, 2017 at 11:04 PM, Andreas Karlsson <andreas(at)proxel(dot)se>
> wrote:
>> On 03/29/2017 05:43 AM, Haribabu Kommi wrote:
>> > Updated patch attached.
>> I get a test failure in the pg_upgrade tests, but I do not have time
>> right now to investigate.
>> The failing test is "Restoring database schemas in the new cluster".
> Thanks for test.
> I found the reason for failure.
> Before this refactor patch, in case of --binary-upgrade, the pg_dumpall
> dumps all the global objects and also the database objects. These objects
> will be restored first during the preparation of the new cluster and later
> each individual database is restored.
> Because of the refactoring of the database objects, currently as part of
> globals dump with --binary-upgrade, no database objects gets dumped.
> During restore no databases are created. so while restoring individual
> database, it leads to failure as it not able to connect to the target
> database.

I modified the pg_upgrade code to use template1 database as a connecting
database while restoring the dump along with --create option to pg_restore
to create the database objects instead of connecting to the each individual

And also while dumping the database objects, passed the new option of
--enable-pgdumpall-behaviour to pg_dump to dump the database objects
as it expected dump during pg_dumpall --binary-upgrade.

Both pg_dump and pg_upgrade tests are passed. Updated patch attached
I will add this patch to the next commitfest.

Hari Babu
Fujitsu Australia

Attachment Content-Type Size
pg_dump_changes_5.patch application/octet-stream 47.3 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-04-04 05:12:36 Re: ANALYZE command progress checker
Previous Message Andres Freund 2017-04-04 04:52:01 Re: PATCH: Batch/pipelining support for libpq