Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzL0-0002Pb-7B for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:40:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WDzKz-0007NE-Fi for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:40:33 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzKy-0007N4-F2 for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:40:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzKv-0000RS-Pu for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:40:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s1DGeTTx005152; Thu, 13 Feb 2014 11:40:29 -0500 From: Tom Lane To: David Johnston cc: pgsql-bugs@postgresql.org, "Rick Otten" Subject: Re: BUG #9202: C Functions crash database too easily In-reply-to: <1392308670918-5791875.post@n5.nabble.com> References: <20140212205302.2708.53160@wrigleys.postgresql.org> <1392308670918-5791875.post@n5.nabble.com> Comments: In-reply-to David Johnston message dated "Thu, 13 Feb 2014 08:24:30 -0800" Date: Thu, 13 Feb 2014 11:40:29 -0500 Message-ID: <5151.1392309629@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David Johnston 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs