Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement
Дата
Msg-id 22641.1171955272@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement  (Arjen van der Meijden <acmmailing@tweakers.net>)
Ответы Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement  (Arjen van der Meijden <acmmailing@tweakers.net>)
Список pgsql-bugs
Arjen van der Meijden <acmmailing@tweakers.net> writes:
> I had a look at that _close_pgsql_link-function and this it the code:

>      while ((res = PQgetResult(link))) {
>          PQclear(res);
>      }

> So there is indeed a very clear loop. But I'm not sure whether this code
> is incorrect as a generic "close the connection cleanly without memory
> leaks"-function?

It's surely incorrect as a means of getting out of a COPY state.  To
tell the truth, if their intention is to close the connection
unceremoniously, they should just do that, ie PQfinish or just quit
the application.  So I'd suggest removing that loop.

            regards, tom lane

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

Предыдущее
От: Arjen van der Meijden
Дата:
Сообщение: Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement
Следующее
От: Arjen van der Meijden
Дата:
Сообщение: Re: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement