Re: functions + shared libraries - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: functions + shared libraries
Date
Msg-id 3DF4EE44.9589.54ECA9@localhost
Whole thread Raw
In response to Re: functions + shared libraries  (Doug McNaught <doug@mcnaught.org>)
List pgsql-general
On 9 Dec 2002 at 8:42, Doug McNaught wrote:

> Eric B.Ridge <ebr@tcdi.com> writes:
>
> > Is it possible, via a shared library that contains functions used by
> > postgres, to detect when the library is first loaded and when it is
> > unloaded?
>
> You could have a 'static' variable in the library, that all its
> functions check first thing, and set to 1 after checking.  That would
> be a little clumsy, but would work.

I do not know the postgresql code, but I believe, postgresql must be doing a
dlopen internally. So if you define _init and _fini, they would called while
loading and unloading the library.

At least it is that way on linux. Check with man page of dlopen on the platform
you are running..

HTH

Bye
 Shridhar

--
Great American Axiom:    Some is good, more is better, too much is just right.


pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: functions + shared libraries
Next
From: "Ian Harding"
Date:
Subject: Re: UPDATE syntax problem