pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Johnston <polobo@yahoo.com>
Cc: pgsql-bugs@postgresql.org
Cc: Rick Otten <rotten@windfish.net>
Subject: Re: BUG #9202: C Functions crash database too easily
Date: Thu, 13 Feb 2014 11:40:29 -0500
Message-ID: <5151.1392309629@sss.pgh.pa.us> (raw)
In-Reply-To: <1392308670918-5791875.post@n5.nabble.com>
References: <20140212205302.2708.53160@wrigleys.postgresql.org>
	<1392308670918-5791875.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)

Message-ID: <5151.1392309629@sss.pgh.pa.us>
Permalink:  ../5151.1392309629@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5151.1392309629@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, polobo@yahoo.com, rotten@windfish.net
  Subject: Re: BUG #9202: C Functions crash database too easily
  In-Reply-To: <5151.1392309629@sss.pgh.pa.us>
  References: <20140212205302.2708.53160@wrigleys.postgresql.org> <1392308670918-5791875.post@n5.nabble.com> <5151.1392309629@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox