Re: BUG #9202: C Functions crash database too easily

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #9202: C Functions crash database too easily
Дата
Msg-id 5151.1392309629@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #9202: C Functions crash database too easily  (David Johnston <polobo@yahoo.com>)
Список pgsql-bugs
David Johnston <polobo@yahoo.com> writes:
> I would hope that the only typos you would be encountering in this use-case
> are file-name typos which would correctly generate "file not found" errors.
> Complain to the third-party that they are not making your installation easy
> enough because they have not provided fully tested scripts for you to run to
> setup their library - or ideally the capability to issue "CREATE EXTENSION".

Yeah --- a C function should certainly come with a matching, tested
CREATE FUNCTION command in some kind of script.

After replying to Rick, I thought briefly about the possibility of
embedding the appropriate CREATE, as a string, in the loadable module.
This wouldn't exactly be bulletproof though --- there's still about as
much chance of human error causing the string constant to not match
the code as there is of an external file not matching the code.  Also,
our experience with extensions suggests that there's usually a whole
bunch of other SQL commands (such as CREATE TYPE, CREATE OPERATOR, etc)
that also have to match up.  Not to mention the possibility of version
upgrade scripts.  So I think the packaging technology we have,
namely SQL script file(s) that should match the code in a loadable
library, is probably really pretty reasonable from this standpoint.

It sounds like Rick is trying to deal with some code that wasn't
actually packaged that way :-(

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: BUG #9202: C Functions crash database too easily
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #9198: psql -c 'SET; ...' not working