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 C24E452A0E for ; Fri, 8 Jul 2005 09:32:44 -0300 (ADT) 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 12084-02 for ; Fri, 8 Jul 2005 12:32:35 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id BF94F529D7 for ; Fri, 8 Jul 2005 09:32:33 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j68CWUQ4099154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Jul 2005 06:32:33 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j68CWU4k060869; Fri, 8 Jul 2005 06:32:30 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j68CWU8s060868; Fri, 8 Jul 2005 06:32:30 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 8 Jul 2005 06:32:30 -0600 From: Michael Fuhr To: "jimmy.olsen" Cc: pgsql-sql@postgresql.org Subject: Re: getting back autonumber ... Another MsSQL Comparation Question Message-ID: <20050708123230.GA60834@winnie.fuhr.org> References: <42CD6B58.6060508@techevolution.be> <20050707180329.GA11332@alvh.no-ip.org> <003c01c583b4$3e20b510$230a0a0a@ligaone.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003c01c583b4$3e20b510$230a0a0a@ligaone.com.br> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/65 X-Sequence-Number: 22043 [Please start a new thread when asking new questions.] On Fri, Jul 08, 2005 at 08:56:56AM -0300, jimmy.olsen wrote: > I need to know the number of affected (Inserted, deleted, updated) > rows by a Query. In MsSQL I use SELECT @@ROWCOUNT, similar to SELECT > @@IDENTITY. Is there any @@RowCount similar statement in PostGres?? Your client interface should have a function to get the row count. In libpq, for example, you can call PQcmdTuples(); in PL/pgSQL you can use GET DIAGNOSTICS. See the documentation for whatever interface you're using. -- Michael Fuhr http://www.fuhr.org/~mfuhr/