Re: debug a mess

Поиск
Список
Период
Сортировка
От Wei Weng
Тема Re: debug a mess
Дата
Msg-id 20030225155820.B24120@example.com
обсуждение исходный текст
Ответ на debug a mess  (Wei Weng <wweng@kencast.com>)
Ответы Re: debug a mess
Re: debug a mess
Список pgsql-interfaces
On 25/02/03 14:29 -0600, Matthew Vanecek wrote:
> It sounds like you've executed a query or command, and have not called
> PQclear(result) on the results.  Whenever I've gottten that error, not
> clearing the results has always been the root cause.  Make sure result
> is not NULL first, of course...
> 
>
The entire code from PQconnect until PQfinish goes like this:
   pgconn = PQconnect(init_string);
   res = PQexec(pgconn, my_query);
   if (res == NULL)       quit;
   switch( PQresultStatus(res) )   {       case ... goto _end;       case ... goto _end;       ...       default ...
goto_end;   }
 
   PQclear(res);   res = NULL;

_end:   if (res)       PQclear(res);
   PQfinish(pgconn);


This is pretty much the skeleton of the code, as you can see, I treat res
pretty carefully, PQclear it whenever necessary.

Thanks


Wei





В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Matthew Vanecek
Дата:
Сообщение: Re: ECPG and C++ compilation
Следующее
От: "Jeroen T. Vermeulen"
Дата:
Сообщение: Re: debug a mess