Re: LOADing functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Becker <acbecker(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LOADing functions
Date: 2014-10-31 22:13:25
Message-ID: 11681.1414793605@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Becker <acbecker(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-10-31 22:14:45 Re: LOADing functions
Previous Message Andrew Becker 2014-10-31 22:00:57 LOADing functions