Thread: Connection pooling with C and libpq

Connection pooling with C and libpq

From
Kassu Valtakari
Date:
Hei!

How do I do the connection pooling with libpq? I'm trying to modify
a radius server to fork or thread and pick a connection from the pool
and in that way be able to store 100..500 small records in a second
into postgresql.
I can create a global array of connections, but how is it done after
that? I'm sure there's people who think it's trivial and simple, but I
also think that seeing someone's ready tested code helps me a lot.

Also an example with threads or forks in the code could be interesting.
--
--  Kassu Valtakari, kassu at iki.fi, +49 89 722 43448
--  Quidquid latine dictum sit, altum viditur