in reply to Looking for a way to use one database connection with multiple CGI scripts

It seems to me you want a connection pooler, which is a program that (at startup) pre-prepares a smallish pool of connections. Programs request a connection from the pool, and immediately after db-access relinquish the connection back into the pool.

A popular and light-weight connection pooler for the PostgreSQL database is PgBouncer, from the skype developers.

PgBouncer site / manual

and its pgfoundry repository

  • Comment on Re: Looking for a way to use one database connection with multiple CGI scripts (Pg)