pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Shukla, Pranjal <pshukla@akamai.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Restoring using PG_DUMP in PG12 results in
Date: Mon, 14 Mar 2022 07:55:50 -0700
Message-ID: <b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com> (raw)
In-Reply-To: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com>
References: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com>

On 3/14/22 06:39, Shukla, Pranjal wrote:
> Hello,
> 
> We tried importing into an empty database in PG 12 from the dump that 
> was created in PG 10. Import was successful but we got an message that 
> an error was ignored. We agin imported with -e option and the following 
> message was printed:
> 
> pg_restore: while PROCESSING TOC:
> 
> pg_restore: from TOC entry 6; 2615 2200 SCHEMA public postgres
> 
> pg_restore: error: could not execute query: ERROR:schema "public" 
> already exists

Basically an informational error that tells you that the restore was 
trying to create an object that already exists, in this case the pubic 
schema. Not really an issue.
> 
> Command was: CREATE SCHEMA public;
> 
> There are some blogs that ar pointing to that fact the error is because 
> of different versions of PG Admin Utility namely different versions of 
> pg_dump() and pg_resotre() command in source and destination versions. 
> We use the following command for pg_dump and pg_restore.
> 

>  1. Have you faced this scenario?
>  2. Off the approaches mentioned above, which one do you think we should
>     opt for while doing migration from PG 10 to 12 (in different machines)?

Honestly I could not follow what you did. Best practice when moving from 
older version to newer version is to use the newer version's pg_dump 
against the older version and then use the newer versions pg_restore or 
psql(for text dumps) to restore.

> 
> PS: Below is the command we use to create database:
> 
> /CREATE DATABASE mydb WITH ENCODING 'UTF8' LC_COLLATE 'C' LC_CTYPE 'C' 
> TEMPLATE template0;/
> 
> *Thanks & Regards*
> 
> *Pranjal Shukla*
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (4+ messages)  latest in thread

Message-ID: <b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com>
Permalink:  ../b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com/
Also on:    postgresql.org/message-id/b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com

 · 

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-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, pshukla@akamai.com
  Subject: Re: Restoring using PG_DUMP in PG12 results in
  In-Reply-To: <b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com>
  References: <09F60E18-C1ED-4878-B866-0B0CE790CB61@akamai.com> <b54e52f3-9673-0295-8860-2e0bbc6131ba@aklaver.com>

* 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