implementing a psql daemon - Mailing list pgsql-general

From Marc Tardif
Subject implementing a psql daemon
Date
Msg-id Pine.BSF.4.10.10001212356001.19785-100000@server.b0x.com
Whole thread Raw
List pgsql-general
I have come to like postgresql and I have written many utilities for
internal usage, mostly related to my mailing list manager. The actual
mailinst list program is written in c and opens and closes only a single
connection for each email received. The problem is mostly with the
utilities which are shell scripts using psql between 1 and 5 times per
script. Needless to say, I can expect to waste many resources if/when
traffic becomes more important.

The solution to this problem could be to write a daemon which would leave
a connection open to a postgresql database. Then, when data is needed, I
could pass the query using shared memory and perhaps semaphores to avoid
concurrent access to the daemon therefore avoiding the overhead of
creating a connection each time. I could then use this same method for my
mailing list manager and each utility (which would have to be re-written
in c) all of which would use the same connection provided by the daemon.

Unfortunately, my understanding of the subject is somewhat limited. I can
manage to write the daemon using books and sample source code, but I'm not
in a position to weigh the pros and cons of such a solution. Therefore, I
would like to sollicit your feedback to gain a better understanding of the
problem at hand.

Looking forward to your insight,
Marc


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] max(oid)
Next
From: Omkar Prabhu
Date:
Subject: ...