pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: zam6ak@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15466: Logical backups from v10 cannot be restored with v11 - "ERROR: schema "public" already exists"
Date: Wed, 07 Nov 2018 19:54:25 -0500
Message-ID: <20849.1541638465@sss.pgh.pa.us> (raw)
In-Reply-To: <15466-0b90383ff69c6e4b@postgresql.org>
References: <15466-0b90383ff69c6e4b@postgresql.org>

=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> When trying to restore logical backups taken on PostgreSQL v10.x (v10
> pg_dump, either using custom file format or directory) on PostgreSQL v11
> (v11 pg_restore), following error occurs:
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 3; 2615 2200 SCHEMA public
> postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  schema "public"
> already exists
>     Command was: CREATE SCHEMA public;

Yeah, this is a side effect of some intentional changes to the way that
the public schema is backed up.  v10 used to include the public schema
in the dump, and then pg_restore had some very ugly (and buggy) hacks
to skip that dump item.  v11 doesn't do it like that anymore.  We got
rid of the bugs, but the price is that if you want to restore a pre-v11
dump file using v11 pg_restore, you can't use --exit-on-error.

(It's not that unusual for similar situations to occur with cross-version
dump-restore situations.  I don't know if we'll ever get to a situation
where --exit-on-error can be counted on to never complain; but there is
a reason why it's not the default behavior.)

			regards, tom lane




view thread (2+ messages)

Message-ID: <20849.1541638465@sss.pgh.pa.us>
Permalink:  ../20849.1541638465@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20849.1541638465@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zam6ak@gmail.com
  Subject: Re: BUG #15466: Logical backups from v10 cannot be restored with v11 - "ERROR: schema "public" already exists"
  In-Reply-To: <20849.1541638465@sss.pgh.pa.us>
  References: <15466-0b90383ff69c6e4b@postgresql.org> <20849.1541638465@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox