Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
От | Magnus Hagander |
---|---|
Тема | Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME |
Дата | |
Msg-id | CABUevEyBKGBHmAUyyhF=3fMONXSPQ6iCMv4LG8bGYnsM87De_A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME
Re: [BUGS] *.sql contrib files contain unresolvable MODULE_PATHNAME |
Список | pgsql-hackers |
On Wed, Oct 12, 2011 at 19:36, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Magnus Hagander <magnus@hagander.net> writes: >> On Wed, Oct 12, 2011 at 17:40, Tom Lane <tgl@sss.pgh.pa.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 great to me. I guess the failure scenario is if someone has an extension from 9.1.2 and tries to load it into 9.1.1 or earlier, in which case they will get a syntax error or somehing when trying to run the CREATE EXTENSION command, right? I doubt that's something worth dealing with - it's a lot less likely to happen. We might want to document this for other third-party extension developers to use as a trick as well? -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
В списке pgsql-hackers по дате отправления: