Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D3F0B4A2A39 for ; Sat, 25 Feb 2012 15:51:38 -0400 (AST) Received: from mail-yx0-f174.google.com ([209.85.213.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S1Neb-0007kQ-5f for pgsql-admin@postgresql.org; Sat, 25 Feb 2012 19:51:38 +0000 Received: by yenm8 with SMTP id m8so1598161yen.19 for ; Sat, 25 Feb 2012 11:51:24 -0800 (PST) Received-SPF: pass (google.com: domain of cmdrclueless@gmail.com designates 10.236.182.2 as permitted sender) client-ip=10.236.182.2; Authentication-Results: mr.google.com; spf=pass (google.com: domain of cmdrclueless@gmail.com designates 10.236.182.2 as permitted sender) smtp.mail=cmdrclueless@gmail.com; dkim=pass header.i=cmdrclueless@gmail.com Received: from mr.google.com ([10.236.182.2]) by 10.236.182.2 with SMTP id n2mr13221936yhm.11.1330199484208 (num_hops = 1); Sat, 25 Feb 2012 11:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=U6hsQLGGl8Jp4Ivx1xZDIeTin3PRhzYc7TPebVO1c68=; b=x2l6dwgO1pEvDZ7VRIAFYnyRyROwxmVTTMJjbSm3pB2PFYTMokJpqD1vKYhrubFfjy SD9S26rkDIUwMMSRlnE7jjIfBeH+AietHES8boQqb6wbQxvjBAbaRCz2q1LdGb7edID9 Lxx8Ewua1OzuvkUb0rwdAOrNTrKPUt1r5Rgrg= Received: by 10.236.182.2 with SMTP id n2mr9965501yhm.11.1330199484112; Sat, 25 Feb 2012 11:51:24 -0800 (PST) Received: from [10.128.64.24] (cpe-174-099-095-235.nc.res.rr.com. [174.99.95.235]) by mx.google.com with ESMTPS id b6sm14564944anc.3.2012.02.25.11.51.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 25 Feb 2012 11:51:23 -0800 (PST) References: <4F4820C8.2000703@iii.com> <1330183903.2593.1.camel@localhost.localdomain> <17919563-C079-438C-9702-5A0806127DFD@gmail.com> <274BAD81-38BF-4537-B474-ADCDF77E318A@elevated-dev.com> <1330193409.2593.5.camel@localhost.localdomain> In-Reply-To: <1330193409.2593.5.camel@localhost.localdomain> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <2E7B4488-D6BB-4274-ABE1-74B147244486@gmail.com> Cc: Scott Ribe , "pgsql-admin@postgresql.org" X-Mailer: iPhone Mail (9A405) From: Brian Weaver Subject: Re: Problems with pg_restore (plpgsql already exists) Date: Sat, 25 Feb 2012 14:51:20 -0500 To: Guillaume Lelarge X-Pg-Spam-Score: -1.6 (-) X-Archive-Number: 201202/107 X-Sequence-Number: 39167 Thank you all for the explanation. I'll work around the issue. It's nice to u= nderstand the thought process even though I might disagree with it.=20 -- Brian Sent from my iPhone On Feb 25, 2012, at 13:10, Guillaume Lelarge wrote:= > On Sat, 2012-02-25 at 09:23 -0700, Scott Ribe wrote: >> On Feb 25, 2012, at 9:18 AM, Brian Weaver wrote: >>=20 >>> Thanks for the pointer. Is it just me that finds it the behavior of pg_r= estore odd? If the default installation since 9.0 has PL/PgSQL installed the= n why does pg_restore still emit statements to create the language? As a dev= eloper by trade it smells like a bug.=20 >>=20 >> It's pg_dump that's emitting the command to create the language. If you r= an pg_dump from 9.0+, it would not do so. >=20 > 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. >=20 > 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. >=20 >> This is an example of why the standard advice for upgrading is to use the= newer pg_dump against the older database >=20 > Exactly. >=20 >=20 > --=20 > Guillaume > http://blog.guillaume.lelarge.info > http://www.dalibo.com >=20