For now I am guessing in your application you are using ODBC to connect to the server, correct?
Correct.
1) What does the function do?
It calculates a lot of things and issues documents. I have much more complicated functions and never experienced such problems with this application.
2) Where are the database and pgAdmin and the application in relation to each other? In other words are they on the same machine or are they going across a network?
The application and the pgAdmin are on the same client, connecting to server through LAN.