See attached diff which corrects a per-thread memory leak in libecpg and changes the thread test program to create a user defined number of threads. Also attached tar.gz adds an additional thread test, which currently does NOT work as expected and is one of the cases Shridar and I will be looking at (removing need for AT xxx on every EXEC SQL).
Note, the updated test shows that ECPG currently DOES support the specification of connection names by host variables (not only static strings as I had said previously).
Thanks, L.