Re: [GENERAL] Need help with libpq and PQexec

2009-08-11 Thread David Wilson
On Tue, Aug 11, 2009 at 3:35 AM, Juan Backson wrote: > PGRES_COMMAND_OK You want PGRES_TUPLES_OK for a select statement. You're not getting an actual failure- you're checking for the wrong status. -- - David T. Wilson david.t.wil...@gmail.com -- Sent via pgsql-general mailing list (pgsql-gener

Re: [GENERAL] Need help with libpq and PQexec[RESOLVEd]

2009-08-11 Thread Juan Backson
I used if (PQresultStatus(res) != PGRES_TUPLES_OK) and it is fine now. Thanks, JB On Tue, Aug 11, 2009 at 3:35 PM, Juan Backson wrote: > Hi, > In my source code, I have: > > res = PQexec(conn,"select * from resource"); > if(PQresultStatus(res) != PGRES_COMMAND_OK){ > switch_log_pr

[GENERAL] Need help with libpq and PQexec

2009-08-11 Thread Juan Backson
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; }