Re: functions + shared libraries

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: functions + shared libraries
Date: 2002-12-09 13:55:56
Message-ID: 3DF4EE44.9589.54ECA9@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9 Dec 2002 at 8:42, Doug McNaught wrote:

> Eric B.Ridge <ebr(at)tcdi(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pginfo 2002-12-09 14:18:40 Re: pg 7.3 memory error
Previous Message Doug McNaught 2002-12-09 13:42:46 Re: functions + shared libraries