X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1ED432C239 for ; Fri, 15 Oct 2004 09:57:30 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36538-03 for ; Fri, 15 Oct 2004 08:57:26 +0000 (GMT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id 6495632C214 for ; Fri, 15 Oct 2004 09:57:26 +0100 (BST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Fri Oct 15 10:57:20 2004 +0200 Received: from rodos.fzk.de (resy6.fzk.de [141.52.68.10]) by resy5.fzk.de (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id i9F8vILi007526; Fri, 15 Oct 2004 10:57:19 +0200 Message-ID: <416F90ED.A65CB3B1@rodos.fzk.de> Date: Fri, 15 Oct 2004 10:57:18 +0200 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: sad Cc: pgsql-sql@postgresql.org Subject: Re: libpq-fe: PQgetvalue() ? References: <200410141634.22769.sad@bankir.ru> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS - amavis-milter (http://www.amavis.org/) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/98 X-Sequence-Number: 19201 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 >