[EMAIL PROTECTED] wrote:
> hi
>
> does PQgetvalue() allocate memory rof its result, it returns ?
> the answer will help me in problem:
> should i free some cstring_variable if
> { cstring_variable=PQgetvalue(pgresult_variable,0,0); }
> and could i PQclear(pgresult_varible) while cstring_varible is in use.

>From the documentation:
    The pointer returned by PQgetvalue points to storage that is part of
  the PGresult structure. One should not modify the data it points to, and
  one must explicitly copy the data into other storage if it is to be used
  past the lifetime of the PGresult structure itself.

So no, you must not free your copy of the pointer returned by PQgetvalue,
and no, once you PQclear the result your pointer is not valid. You should

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to