Hi,

 

 When I use ecpg  code to download File from database, error  occurred
occasionally as below:

“could not connect to server: Connection timed out    Is the server running
on host "DB" and accepting        TCP/IP connections on port 5432?” 

 

This my code:

 

                  conn = PQsetdbLogin(host, NULL, NULL, NULL, database,
username, "") ;

                if (PQstatus (conn) != CONNECTION_BAD){

                PQexec(conn, "BEGIN");

                if (lo_export(conn,oidImage_Data,chImageName) == -1) {

                    printf("PQSTATUS=%s \n",PQerrorMessage(conn));

                    PQfinish (conn) ;

                    printf("EXPORT %s ERROR! SQL STATE =   %s\n
",chImageName,sqlca.sqlstate);

                }

                printf("PQSTATUS=%s \n",PQstatus(conn));

                PQexec(conn, "COMMIT");

 

This log was found in postgres.log:

Oct 18 10:44:35 SUC02 postgres[10159]: [7-1] LOG:  database system is ready

Oct 18 10:44:35 SUC02 postgres[10159]: [8-1] LOG:  transaction ID wrap limit
is 3343152371, limited by database "template1"

Oct 18 10:46:11 SUC02 postgres[10997]: [2-1] LOG:  unexpected EOF on client
connection

Oct 18 10:46:11 SUC02 postgres[15899]: [2-1] LOG:  could not receive data
from client: Connection reset by peer

Oct 18 10:46:11 SUC02 postgres[15899]: [3-1] LOG:  unexpected EOF on client
connection

 

What is the problem ? What should I  <javascript:void(0)> investigate ? 

Please help ! Thank you very much !

 

Ray Huang

2009-10-20

 

 

Reply via email to