From: Christoph Haller <ch@rodos.fzk.de>
To: sad <sad@bankir.ru>
Cc: pgsql-sql@postgresql.org
Subject: Re: libpq-fe: PQgetvalue() ?
Date: Fri, 15 Oct 2004 10:57:18 +0200
Message-ID: <416F90ED.A65CB3B1@rodos.fzk.de> (raw)
References: <200410141634.22769.sad@bankir.ru>
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 suppose.
Regards, Christoph
sad 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.
>
> thnx
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ch@rodos.fzk.de, sad@bankir.ru
Subject: Re: libpq-fe: PQgetvalue() ?
In-Reply-To: <416F90ED.A65CB3B1@rodos.fzk.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox