Tom Lane wrote:
>
> "Patrick Welche" <prlw1(at)newn(dot)cam(dot)ac(dot)uk> writes:
> > I am having trouble with PQclear causing a segmentation fault, and I don't
> > really know where to look.
>
> Not at PQclear(); almost surely, the bug lies elsewhere.
...
> Unfortunately that means the bug might be almost anywhere else in
> your app :-(. Good luck...
Sure enough - pass the PgDatabase as a reference was the solution!
Cheers,
Patrick