libpq & freeing character results

Поиск
Список
Период
Сортировка
От Robert A. Knop Jr.
Тема libpq & freeing character results
Дата
Msg-id Pine.LNX.4.10.10006271204130.1921-100000@lilys.lbl.gov
обсуждение исходный текст
Ответы Re: libpq & freeing character results
Perl modules for Perl on NT
Re: libpq & freeing character results
Список pgsql-interfaces
If one uses libpq functions such as PQfname, should one free the returned
character string?

What I'm really asking is, are you getting a pointer into something
internal to the PGresult structure, which is only valid as long as the
PGresult structure is valid, and which must be copied if it is to exist
after that; or, are you getting a copy of that memory, which is yours to
do with as you please (and your responsibility)?

This is explicitly answered in the documentation for PQgetvalue (it's a
pointer into the PGresult data), so I'm assuming thatt he same applies for
PQfname.  Please let me know if this is a foolish assumption.

-Rob
rknop@lbl.gov




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

Предыдущее
От: Brian Piatkus
Дата:
Сообщение: ODBC (windows) and ALTER USER
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq & freeing character results