From: Tom Lane <tgl@sss.pgh.pa.us>
To: Aidan Van Dyk <aidan@highrise.ca>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: 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 11:15:43 -0400
Message-ID: <13733.1318432543@sss.pgh.pa.us> (raw)
In-Reply-To: <CAC_2qU8P3wT_yijdzGgZphHFUan7zsgFVSToJWE5s2gucX1mhw@mail.gmail.com>
References: <20111012075314.GA25470@piware.de>
<4E954895.6040701@kaltenbrunner.cc>
<4E95523E.1010608@enterprisedb.com>
<CABUevEyy8xW=qfUsWutr660+uWTF+akRPMm_dJ5u4n141bg+WA@mail.gmail.com>
<CA+TgmoaNBwENDdj_+Gv17cQxzT89f0nQX0YkB-y1L4hkNL28_A@mail.gmail.com>
<12966.1318428759@sss.pgh.pa.us>
<4E95A4BE.8050501@dunslane.net>
<13389.1318431017@sss.pgh.pa.us>
<CAC_2qU8P3wT_yijdzGgZphHFUan7zsgFVSToJWE5s2gucX1mhw@mail.gmail.com>
Aidan Van Dyk <aidan@highrise.ca> writes:
> On Wed, Oct 12, 2011 at 10:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Hmm ...
>> \echo You should use CREATE EXTENSION foo to load this file!
> Decorate them with a marker like:
> \extension <name> <version>
> And make the CREATE EXTENSION skip (or verify) it?
> It will make psql stop on the \extension command.
No, the point is not to stop or fail, it is to print out an unmistakable
user instruction. Otherwise we'll still be getting "cube.sql failed to
load for me" bug reports. So I think \echo is entirely sufficient,
and we should not rely on psql features that aren't there yet. Ideally
this should do what we want even in older psql releases. \echo has been
there at least since 7.0.
It strikes me that we could get rid of the error message clutter
I worried about before if we coded like this:
/* contrib/foo--1.0.sql */
\echo Use "CREATE EXTENSION foo" to load this file. \quit
... SQL commands here ...
The forced \quit is a bit unfriendly maybe but it will get the job done.
And again, this isn't making any assumptions about which psql version
you're using.
regards, tom lane
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: tgl@sss.pgh.pa.us, aidan@highrise.ca, andrew@dunslane.net, robertmhaas@gmail.com, magnus@hagander.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: <13733.1318432543@sss.pgh.pa.us>
References: <20111012075314.GA25470@piware.de> <4E954895.6040701@kaltenbrunner.cc> <4E95523E.1010608@enterprisedb.com> <CABUevEyy8xW=qfUsWutr660+uWTF+akRPMm_dJ5u4n141bg+WA@mail.gmail.com> <CA+TgmoaNBwENDdj_+Gv17cQxzT89f0nQX0YkB-y1L4hkNL28_A@mail.gmail.com> <12966.1318428759@sss.pgh.pa.us> <4E95A4BE.8050501@dunslane.net> <13389.1318431017@sss.pgh.pa.us> <CAC_2qU8P3wT_yijdzGgZphHFUan7zsgFVSToJWE5s2gucX1mhw@mail.gmail.com> <13733.1318432543@sss.pgh.pa.us>
* 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