Re: LOADing functions - Mailing list pgsql-general

From Tom Lane
Subject Re: LOADing functions
Date
Msg-id 11681.1414793605@sss.pgh.pa.us
Whole thread Raw
In response to LOADing functions  (Andrew Becker <acbecker@gmail.com>)
List pgsql-general
Andrew Becker <acbecker@gmail.com> writes:
> Hi - I seem to be unable to reLOAD a shared library within the session
> that I LOADed it.

Nope, you can't, there's no such functionality.

> Hints as to what is going wrong here?  I would certainly expect to be
> able to re-load a shared library while debugging my UDF.

That would require being able to unload it, which is an operation fraught
with hazards.  We used to allow that, but gave it up after observing that
practically every extant extension could be made to crash on unload.
There is for instance no safe way to get out of a function hook --- the
code pattern you may have seen of restoring the prior value is wrong and
unsafe, because it doesn't account for some other extension having plugged
into the hook after you.  You'd leave that other extension kneecapped,
with some of its hook callbacks disabled but others perhaps not.

            regards, tom lane


pgsql-general by date:

Previous
From: Andrew Becker
Date:
Subject: LOADing functions
Next
From: Adrian Klaver
Date:
Subject: Re: LOADing functions