[SQL] libpq

2010-08-10 Thread Dmitriy Igrishin
Hey all, Is it guaranteed that functions, which accept PGconn* properly works if PGconn* is NULL (or just 0) and returns in such cases the same values as for not-NULL PGconn* ? If so, I think it should be documented ?! Regards, Dmitriy

Re: [SQL] libpq-fe: PQgetvalue() ?

2004-10-19 Thread ljb
[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

Re: [SQL] libpq-fe: PQgetvalue() ?

2004-10-15 Thread Tom Lane
Christoph Haller <[EMAIL PROTECTED]> writes: > You cannot PQclear(pgresult_varible) while cstring_varible is in use. > You do not need to free cstring_variable, PQclear(pgresult_varible) will do. > I personally prefer to allocate local memory, "strcpy" PQgetvalue, > and then PQclear. But that's a m

Re: [SQL] libpq-fe: PQgetvalue() ?

2004-10-15 Thread Christoph Haller
AFAIK it does allocate memory. You cannot PQclear(pgresult_varible) while cstring_varible is in use. You do not need to free cstring_variable, PQclear(pgresult_varible) will do. I personally prefer to allocate local memory, "strcpy" PQgetvalue, and then PQclear. But that's a matter of taste, I supp

[SQL] libpq-fe: PQgetvalue() ?

2004-10-14 Thread sad
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. thnx --