Re: pg_restore issue

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo M. Ramé 2014-02-12 19:46:02 Re: pg_restore issue
Previous Message Jerry Sievers 2014-02-12 19:02:51 Re: pg_restore issue