Skip site navigation (1) Skip section navigation (2)

Re: Problems with pg_restore (plpgsql already exists)

From: Brian Weaver <cmdrclueless(at)gmail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Problems with pg_restore (plpgsql already exists)
Date: 2012-02-25 19:51:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Thank you all for the explanation. I'll work around the issue. It's nice to understand the thought process even though I might disagree with it. 

-- Brian

Sent from my iPhone

On Feb 25, 2012, at 13:10, Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:

> On Sat, 2012-02-25 at 09:23 -0700, Scott Ribe wrote:
>> On Feb 25, 2012, at 9:18 AM, Brian Weaver wrote:
>>> Thanks for the pointer. Is it just me that finds it the behavior of pg_restore odd? If the default installation since 9.0 has PL/PgSQL installed then why does pg_restore still emit statements to create the language? As a developer by trade it smells like a bug. 
>> It's pg_dump that's emitting the command to create the language. If you ran pg_dump from 9.0+, it would not do so.
> Not quite true. pg_dump from 9.0 does save the language definition, but
> it uses the new CREATE OR REPLACE statement for languages, so that, when
> you restore it in a 9.0+ database that already has the same language, it
> won't complain with an error message.
> BTW, it isn't odd that pg_dump 9.0 save the language definition. Having
> by default the plpgsql language when you create a database doesn't mean
> you can't drop it.
>> This is an example of why the standard advice for upgrading is to use the newer pg_dump against the older database
> Exactly.
> -- 
> Guillaume

In response to

pgsql-admin by date

Next:From: WissemDate: 2012-02-27 10:17:11
Subject: Re: Automatic Failover Hot Standby / Streaming replication
Previous:From: Guillaume LelargeDate: 2012-02-25 18:10:09
Subject: Re: Problems with pg_restore (plpgsql already exists)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group