Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B684BB5DBCA for ; Wed, 12 Oct 2011 12:15:53 -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 54323-07 for ; Wed, 12 Oct 2011 15:15:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2C39EB5DBC0 for ; Wed, 12 Oct 2011 12:15:47 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p9CFFh2L013734; Wed, 12 Oct 2011 11:15:43 -0400 (EDT) To: Aidan Van Dyk cc: Andrew Dunstan , Robert Haas , Magnus Hagander , Heikki Linnakangas , Stefan Kaltenbrunner , PostgreSQL Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME In-reply-to: References: <20111012075314.GA25470@piware.de> <4E954895.6040701@kaltenbrunner.cc> <4E95523E.1010608@enterprisedb.com> <12966.1318428759@sss.pgh.pa.us> <4E95A4BE.8050501@dunslane.net> <13389.1318431017@sss.pgh.pa.us> Comments: In-reply-to Aidan Van Dyk message dated "Wed, 12 Oct 2011 11:01:26 -0400" Date: Wed, 12 Oct 2011 11:15:43 -0400 Message-ID: <13733.1318432543@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/718 X-Sequence-Number: 196524 Aidan Van Dyk writes: > On Wed, Oct 12, 2011 at 10:50 AM, Tom Lane wrote: >> Hmm ... >> \echo You should use CREATE EXTENSION foo to load this file! > Decorate them with a marker like: > \extension > 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