Re: pg_restore issue

From: Leonardo M(dot) Ramé <l(dot)rame(at)griensu(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore issue
Date: 2014-02-12 19:46:02
Message-ID: 20140212194602.GD6171@leonardo-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2014-02-12 14:04:41 -0500, Tom Lane wrote:
> Leonardo =?iso-8859-1?Q?M=2E_Ram=E9?= <l(dot)rame(at)griensu(dot)com> writes:
> > On 2014-02-12 13:30:52 -0500, Tom Lane wrote:
> >> The -c switch causes pg_restore to try to DROP every object it's about to
> >> restore. If you're restoring into an empty database then this is useless,
> >> and in fact will not work if you're also using --exit-on-error. Remove
> >> one or the other switch.
>
> > Tom, I've dropped the db, then createdb again, then removed the -c
> > option, now I get this error:
>
> > pg_restore: [archiver (db)] Error while PROCESSING TOC:
> > pg_restore: [archiver (db)] Error from TOC entry 735; 2612 213488
> > PROCEDURAL LANGUAGE plpgsql postgres
> > pg_restore: [archiver (db)] could not execute query: ERROR: language
> > "plpgsql" already exists
> > Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
>
> pg_dump versions more recent than 8.4 use "CREATE OR REPLACE PROCEDURAL
> LANGUAGE" to work around the possibility that plpgsql is preinstalled.
> If you don't want to use a modern pg_dump, you'll need to not use
> --exit-on-error.
>
> In general, it's recommended to use the newer pg_dump when trying to
> transfer data from an older installation to a newer one. You can
> generally make it work without that, but it's not necessarily going
> to be seamless, and one of the ways it tends to not be seamless is
> that you have to be willing to ignore harmless errors.
>

Ok, I understand your reasoning. Removing -c and --exit-on-error fixed
the issue.

BTW, I've used --exit-on-error because there were many errors, and I wanted
to fix each one of them.

Regards,
--
Leonardo M. Ramé
Medical IT - Griensu S.A.
Av. Colón 636 - Piso 8 Of. A
X5000EPT -- Córdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877

In response to

Browse pgsql-general by date

  From Date Subject
Next Message alexandros_e 2014-02-12 20:20:57 Pg_trgm and "invalid invalid byte sequence for encoding UTF8"
Previous Message Tom Lane 2014-02-12 19:04:41 Re: pg_restore issue