On Tue, Jun 27, 2000 at 12:06:44PM -0700, Robert A. Knop Jr. wrote:
> If one uses libpq functions such as PQfname, should one free the returned
> character string?
> 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.
It does correspond to the general style of the interface -- and peeking
into the implementation...
returns NULL if the field_num is invalid
PQfname(PGresult *res, int field_num)
if (!check_field_number("PQfname", res, field_num))
(from src/interfaces/libpq/fe-exec.c; it's version 6.5.3, but I don't
think it has changed) confirms the conjecture.
In response to
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 2000-06-27 21:36:57|
|Subject: Re: libpq & freeing character results |
|Previous:||From: Robert A. Knop Jr.||Date: 2000-06-27 19:06:44|
|Subject: libpq & freeing character results|