Hi,
I've created a Objective-C class to interface with PostgreSQL using libpq. It mostly works but I have one small problem - the connection seems to disappear randomly.
This class is set to open a connection when a window is opened and close that connection before the window closes. On the init code of the window I open the connection and I listen to notifications so I can close the connection with PQfinnish().
Now if I open that window, I can run as many queries as I want. But if I close it and open it again I get an EXC_BAD_ACCESS error. The error seems to be inside libpq but I've no idea what I'm doing wrong - there's no examples to follow which makes it a bit harder to follow patterns.
I believe there seems to be a problem with the connection object but I can't find out exactly what as all diagnostic functions seem to be returning the right values.
Postgresql 8.0, running on latest OS X, latest Xcode and project targeted at 10.5