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] Inserting into table only if the row does not already

2004-10-15 Thread C. Bensend
> You just have to put it in the select list as a constant. If you're > feeling > generous to the next programmer to read it you could put "AS column1" > after > each one, but the column name doesn't actually have to match the column > you're > inserting into. Sweet GOD, I hope no one ever has to

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