Re: BUG #9202: C Functions crash database too easily - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #9202: C Functions crash database too easily
Date
Msg-id 5151.1392309629@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #9202: C Functions crash database too easily  (David Johnston <polobo@yahoo.com>)
List 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 by date:

Previous
From: David Johnston
Date:
Subject: Re: BUG #9202: C Functions crash database too easily
Next
From: Tom Lane
Date:
Subject: Re: BUG #9198: psql -c 'SET; ...' not working