Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0FF6FB5DBDE for ; Wed, 12 Oct 2011 05:39:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 64752-01-8 for ; Wed, 12 Oct 2011 08:39:30 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by mail.postgresql.org (Postfix) with ESMTP id 23286B5DBE3 for ; Wed, 12 Oct 2011 05:39:29 -0300 (ADT) Received: from mail-yw0-f49.google.com ([209.85.213.49]) (using TLSv1) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP; Wed, 12 Oct 2011 01:39:30 PDT Received: by mail-yw0-f49.google.com with SMTP id 9so534761ywf.36 for ; Wed, 12 Oct 2011 01:39:29 -0700 (PDT) Received: by 10.223.77.71 with SMTP id f7mr23559574fak.33.1318408769332; Wed, 12 Oct 2011 01:39:29 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi. [88.195.122.240]) by mx.google.com with ESMTPS id r16sm2533624fam.8.2011.10.12.01.39.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Oct 2011 01:39:28 -0700 (PDT) Message-ID: <4E95523E.1010608@enterprisedb.com> Date: Wed, 12 Oct 2011 11:39:26 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Stefan Kaltenbrunner CC: PostgreSQL Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME References: <20111012075314.GA25470@piware.de> <4E954895.6040701@kaltenbrunner.cc> In-Reply-To: <4E954895.6040701@kaltenbrunner.cc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/691 X-Sequence-Number: 196497 On 12.10.2011 10:58, Stefan Kaltenbrunner wrote: > On 10/12/2011 09:53 AM, Martin Pitt wrote: >> Hello all, >> >> In https://launchpad.net/bugs/835502 it was reported that the 9.1.1 >> contrib *.sql files contain the token "MODULE_PATHNAME", which is >> unknown: >> >> psql test< /usr/share/postgresql/9.1/extension/intarray--1.0.sql >> >> This fails with a ton of errors about the file "MODULE_PATHNAME" not >> existing. >> >> When I replace this with "$libdir/_int", it works: >> >> sed 's!MODULE_PATHNAME!$libdir/_int!g' /usr/share/postgresql/9.1/extension/intarray--1.0.sql | psql test >> >> Is that something I'm doing wrong in the packaging, or should the >> contrib Makefiles be fixed to do this substitution? >> >> It doesn't only affect intarray, but pretty much all *.sql files. > > uh - the reason is that contrib is now packaged as extensions and that > you are supposed to use "CREATE EXTENSION intarray;" on the SQL level > instead of manually loading sql-scripts through psql. 9.1 has been out for only a couple of months, and we've seen a lot of people trying to do that already. In hindsight, we probably should've chosen a different filename extension for those files, to make it clear that you can't just run them in psql. It's too late for that, but a comment at the top of the .sql files would be good: --- a/contrib/intarray/intarray--1.0.sql +++ b/contrib/intarray/intarray--1.0.sql @@ -1,4 +1,8 @@ -/* contrib/intarray/intarray--1.0.sql */ +/* + * contrib/intarray/intarray--1.0.sql + * + * Script file to be run by CREATE EXTENSION. + */ -- -- Create the user-defined type for the 1-D integer arrays (_int4) The people trying to run these files with psql look inside the file when they get the error, so mentioning "CREATE EXTENSION" should give a hint on what to do. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com