Re: allowing multiple PQclear() calls

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: allowing multiple PQclear() calls
Дата
Msg-id 7040.1355209937@sss.pgh.pa.us
обсуждение исходный текст
Ответ на allowing multiple PQclear() calls  (Josh Kupershmidt <schmiddy@gmail.com>)
Список pgsql-hackers
Josh Kupershmidt <schmiddy@gmail.com> writes:
> Would it be crazy to add an "already_freed" flag to the pg_result
> struct which PQclear() would set, or some equivalent safety mechanism,
> to avoid this hassle for users?

Yes, it would.  Once the memory has been freed, malloc() is at liberty
to give it out for some other purpose.  The only way we could make that
work reliably is to permanently leak the memory occupied by the PGresult
... which I trust you will agree is a cure worse than the disease.
        regards, tom lane



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

Предыдущее
От: Darren Duncan
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: [BUG?] lag of minRecoveryPont in archive recovery