Need help with libpq and PQexec

From: Juan Backson <juanbackson(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Need help with libpq and PQexec
Date: 2009-08-11 07:35:19
Message-ID: 27c25bc40908110035s19a44a7ciaf50f2ccdff94262@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Juan Backson 2009-08-11 07:52:50 Re: Need help with libpq and PQexec[RESOLVEd]
Previous Message Jan Verheyden 2009-08-11 07:19:39 mail alert