From: Einar Már Björvinsson <emb(at)media(dot)is>
To: <pgsql-general(at)postgresql(dot)org>
Subject:
Date: 2004-11-02 09:00:58
Message-ID: FF8C432C9271C24F849B585F2C50A71EF287@grunnur.media.is
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi
I have been trying to use the Postgresql library (libpq.so) and processes in my program.
The scenario is like that:

I have made a small shared library where I wrapp the Postgresql functions.

I then call those library functions (my library) from my program.

The program is to behave as a deamon so it is in a endless while loop.

The program starts by opening a connection to the database, enter the infinite while loop to run some functions.

Inside the while loop it forks many childs which then call one function from the library I made.

After one round the program goes to sleep and wakes up again one minute later.

Now comes the problem:: If I call the same the same functions again, those within the while loop (not the connection call) I get an error return.

It is as if the handle to the connection is not valid any more.

I have checked the program without forking and that works fine.

So my question is what can be done to share a library within processes so they are not duplicating the library includes and so on.

regards

Einar

Responses

  • Re: at 2004-11-08 01:13:45 from Tom Lane

Browse pgsql-general by date

  From Date Subject
Next Message Katsaros Kwn/nos 2004-11-02 09:05:34 Re: Split query
Previous Message Tino Wildenhain 2004-11-02 08:53:02 Re: Split query