X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 1EE3E9F9F27 for ; Tue, 18 Jul 2006 15:35:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 59412-02 for ; Tue, 18 Jul 2006 18:35:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by postgresql.org (Postfix) with ESMTP id 729039F94F3 for ; Tue, 18 Jul 2006 15:35:33 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id c29so248741nfb for ; Tue, 18 Jul 2006 11:35:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=GdyJoTJu5q7jyxEP7sVTKK64NcLCW64cZx7Tvpk3X+STsr45gSrrc7kHOIVMxExVMYoLhRa6M3Sub+Ic2OyAWvaB4RhCEYy383HXjavEYlGuoP4nptKcRTZd4bDkBJQ6Wz4nSk8xHIDRJshpjyIDS8+2L+vMDTASb/wwpJn1nSg= Received: by 10.78.122.11 with SMTP id u11mr1688803huc; Tue, 18 Jul 2006 11:35:31 -0700 (PDT) Received: by 10.78.32.10 with HTTP; Tue, 18 Jul 2006 11:35:31 -0700 (PDT) Message-ID: Date: Tue, 18 Jul 2006 13:35:31 -0500 From: "Aaron Bono" To: "Bricklen Anderson" Subject: Re: hi let me know the solution to this question Cc: pgsql-sql@postgresql.org In-Reply-To: <44BD1002.6070505@presinet.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_30101_7701870.1153247731583" References: <20060718053442.GA9694@winnie.fuhr.org> <44BD1002.6070505@presinet.com> X-Google-Sender-Auth: ba6868a6dcefbd65 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/237 X-Sequence-Number: 25811 ------=_Part_30101_7701870.1153247731583 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/18/06, Bricklen Anderson wrote: > > Aaron Bono wrote: > > On 7/18/06, *Michael Fuhr* > wrote: > > > > http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS > > > > > OK, this question got me wondering: is there a way to determine, in a > > function/stored procedure, the number of rows that were > > inserted/updated/deleted? > > > I could not find any documentation about getting the count of updates > > but when you run the update by itself, PostgreSQL reports the number of > > records updated so I have to believe the information is available > > somewhere. > > > > Thanks, > > Aaron > > > Look for the section entitled "36.6.6. Obtaining the Result Status" on > the link that Michael Fuhr supplied (above). Is that what you are > looking for? > Ah yes, I missed the part on ROW_COUNT . That should do it. ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com ================================================================== ------=_Part_30101_7701870.1153247731583 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/18/06, Bricklen Anderson <banderson@presinet.com> wrote:
Aaron Bono wrote:
> On 7/18/06, *Michael Fuhr* <mike@fuhr.org <mailto:mike@fuhr.org>> wrote:
<snip>
>     http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS
<snip>
>
> OK, this question got me wondering: is there a way to determine, in a
> function/stored procedure, the number of rows that were
> inserted/updated/deleted?
<snip>
> I could not find any documentation about getting the count of updates
> but when you run the update by itself, PostgreSQL reports the number of
> records updated so I have to believe the information is available
> somewhere.
>
> Thanks,
> Aaron
>
Look for the section entitled "36.6.6. Obtaining the Result Status" on
the link that Michael Fuhr supplied (above). Is that what you are
looking for?


Ah yes, I missed the part on ROW_COUNT .  That should do it.

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
================================================================== ------=_Part_30101_7701870.1153247731583--