pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Cc: PostgreSQL <Pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
Date: Wed, 12 Oct 2011 09:13:20 -0400
Message-ID: <4E959270.3040803@dunslane.net> (raw)
In-Reply-To: <4E95523E.1010608@enterprisedb.com>
References: <20111012075314.GA25470@piware.de>
	<4E954895.6040701@kaltenbrunner.cc>
	<4E95523E.1010608@enterprisedb.com>



On 10/12/2011 04:39 AM, Heikki Linnakangas wrote:
> 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:
>
>

I've made this mistake myself in an unthinking moment. I suggest that we 
deprecate calling them something.sql and add code ASAP providing for 
some other suffix ( .xtn ?) with legacy support for falling back to 
.sql. I'd almost be inclined to backpatch it while there are so few 
third party extensions out there.

cheers

andrew





view thread (25+ messages)  latest in thread

Message-ID: <4E959270.3040803@dunslane.net>
Permalink:  ../4E959270.3040803@dunslane.net/
Also on:    postgresql.org/message-id/4E959270.3040803@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@dunslane.net, heikki.linnakangas@enterprisedb.com, stefan@kaltenbrunner.cc, Pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
  In-Reply-To: <4E959270.3040803@dunslane.net>
  References: <20111012075314.GA25470@piware.de> <4E954895.6040701@kaltenbrunner.cc> <4E95523E.1010608@enterprisedb.com> <4E959270.3040803@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox