Re: Backup and Restore (pg_dump & pg_restore) - Mailing list pgsql-general

From Tom Lane
Subject Re: Backup and Restore (pg_dump & pg_restore)
Date
Msg-id 16449.1555874751@sss.pgh.pa.us
Whole thread Raw
In response to Re: Backup and Restore (pg_dump & pg_restore)  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 4/21/19 9:35 AM, Daulat Ram wrote:
>> pg_restore: [archiver (db)] could not execute query: ERROR: schema 
>> "public" already exists
>> Command was: CREATE SCHEMA public;

> Expected as the public schema is there by default. It is an 
> informational error, you can ignore it.

It's expected only if you made a dump file with 9.6's pg_dump and
restored it with a later pg_restore; there were some changes in
how the public schema got handled between the two versions.

The usual recommendation when you are doing a version migration
is to use the newer release's pg_dump to suck the data out of
the older server.  If you can't do that, it'll (probably)
still work, but you may have cosmetic issues like this one.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Backup and Restore (pg_dump & pg_restore)
Next
From: Susan Hurst
Date:
Subject: Display View Columns and Their Source Tables and Columns