Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, PostgreSQL <Pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
Date: 2011-10-12 17:36:27
Message-ID: 19678.1318440987@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Wed, Oct 12, 2011 at 17:40, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> The only thing the \echo approach will cost us is a few more lines of C
>> code in execute_extension_script(), and I think it's more than worth
>> that given the evident scope of the problem.

> +1.

PFA, a sample patch for this --- I've only bothered to change one script
file here, but will of course do the rest if there are no further
objections. The technique actually works even better than I expected,
because of the seemingly nowhere documented fact that \quit in a script
file doesn't terminate psql, only processing of the script. So what
I get is

regression=# \i ~/postgres/share/extension/cube--1.0.sql
Use "CREATE EXTENSION cube" to load this file.
regression=#

which is about as good as one could hope for.

(Looks like a patch to the psql docs is upcoming, too.)

regards, tom lane

Attachment Content-Type Size
echo-in-extension-files.patch text/x-patch 3.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2011-10-12 18:21:11 Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
Previous Message John R Pierce 2011-10-12 16:57:32 Re: BUG #6252: After drop the default database 'postgres', I can not create a database by 'createdb.exe'

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-10-12 18:10:57 Re: pg_ctl restart - behaviour based on wrong instance
Previous Message Magnus Hagander 2011-10-12 16:45:31 Re: pg_ctl restart - behaviour based on wrong instance