X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D8D1D8B9FFA for ; Thu, 10 Feb 2005 16:50:02 +0000 (GMT) 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 77254-04 for ; Thu, 10 Feb 2005 16:49:51 +0000 (GMT) Received: from smtp109.mail.sc5.yahoo.com (smtp109.mail.sc5.yahoo.com [66.163.170.7]) by svr1.postgresql.org (Postfix) with SMTP id C7A528B9EF7 for ; Thu, 10 Feb 2005 16:49:49 +0000 (GMT) Received: from unknown (HELO ?172.16.13.13?) (fxjrlists@200.184.102.212 with plain) by smtp109.mail.sc5.yahoo.com with SMTP; 10 Feb 2005 16:49:48 -0000 Message-ID: <420B9122.2090802@yahoo.com.br> Date: Thu, 10 Feb 2005 14:51:46 -0200 From: "Francisco Figueiredo Jr." User-Agent: Mozilla Thunderbird 1.0 (X11/20050121) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Fuhr Cc: pgsql-interfaces@postgresql.org Subject: Re: Function return number of affected rows References: <420B46AC.9080002@yahoo.com.br> <20050210144654.GB68483@winnie.fuhr.org> In-Reply-To: <20050210144654.GB68483@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200502/37 X-Sequence-Number: 5282 Michael Fuhr wrote: > On Thu, Feb 10, 2005 at 09:34:04AM -0200, Francisco Figueiredo Jr. wrote: > >>I'd like to know if it is possible to get the number of affected rows of >>an insert, update or delete command inside a function. > > > Yes, but how you get that information depends on your client interface. > With libpq, for example, you could call PQcmdTuples(). If you're using > something else then see the relevant documentation. > Hi Michael. Thx for info. I will check what PQcmdTuples is doing. > >>I'd like to know that, because I want to add this support, if possible, >>to Npgsql. >> >>I know the server sends a CompletedResponse message indicating the >>number of rows affected by a insert update and delete sent directly. But >>if this is inside a function? Is it possible to get this message too? > > > Does Npgsql use its own implemention of the PostgreSQL protocol? > If so, then that implementation will have to provide the desired > functionality itself. > Yeap. Npgsql implements protocol itself. This is exactly the problem. I'm not receiving the CompletedResponse protocol message when executing the insert inside a function. It is through the CompletedResponse postgresql server says how many rows were affected. But it seems that when calling a function it doesn't return any. Thanks for your feedback Michael. Regards, Francisco Figueiredo Jr.