Need help with libpq and PQexec - Mailing list pgsql-general

From Juan Backson
Subject Need help with libpq and PQexec
Date
Msg-id 27c25bc40908110035s19a44a7ciaf50f2ccdff94262@mail.gmail.com
Whole thread Raw
Responses Re: Need help with libpq and PQexec
List pgsql-general
Hi,
In my source code, I have:

res = PQexec(conn,"select * from resource");
if(PQresultStatus(res) != PGRES_COMMAND_OK){
            switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR,"PQexec failed:%s\n",PQerrorMessage(conn));
            PQclear(res);
            return NULL;
        }
        PQclear(res);

When it is executed, I am getting PGexec failed error , but the return value of  PQerrorMessage(conn) is empty.

Does anyone know why?

Thanks,
JB

pgsql-general by date:

Previous
From: Juan Backson
Date:
Subject: Re: PQstatus does not seem to work
Next
From: Juan Backson
Date:
Subject: Re: Need help with libpq and PQexec[RESOLVEd]