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 0523B8BA054 for ; Thu, 10 Feb 2005 14:47:23 +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 64896-02 for ; Thu, 10 Feb 2005 14:46:56 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 3E81D8B9E97 for ; Thu, 10 Feb 2005 14:46:57 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1AEktI8021102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Feb 2005 07:46:57 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1AEkton070880; Thu, 10 Feb 2005 07:46:55 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1AEksga070879; Thu, 10 Feb 2005 07:46:55 -0700 (MST) (envelope-from mfuhr) Date: Thu, 10 Feb 2005 07:46:54 -0700 From: Michael Fuhr To: "Francisco Figueiredo Jr." Cc: pgsql-interfaces@postgresql.org Subject: Re: Function return number of affected rows Message-ID: <20050210144654.GB68483@winnie.fuhr.org> References: <420B46AC.9080002@yahoo.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <420B46AC.9080002@yahoo.com.br> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/35 X-Sequence-Number: 5280 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. > 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. -- Michael Fuhr http://www.fuhr.org/~mfuhr/