Re: How to retrieve number of rows affected, in an after statement trigger?

From: Zlatko Matić <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to retrieve number of rows affected, in an after statement trigger?
Date: 2007-07-07 20:21:12
Message-ID: 000e01c7c0d4$5f3ab070$e7725bd4@zlatkovyfkpgz6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for the answer.
At least I'm glad it is possible!
But , as I don't know Perl, could you, please, tell me how to accomplish it
in plpgsql.
Thanks,

Zlatko

----- Original Message -----
From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Saturday, July 07, 2007 1:47 PM
Subject: Re: [GENERAL] How to retrieve number of rows affected, in an after
statement trigger?

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
>> Is it possible to retrieve information about how many rows were
>> changed/inserted in a table that fired after statement trigger?
>
> Not directly, but you can store the information from row-level
> triggers and gather it at the end. See this plperl example:
>
> http://people.planetpostgresql.org/greg/index.php?/archives/2007/05/30.html
>
> - --
> Greg Sabino Mullane greg(at)turnstep(dot)com
> PGP Key: 0x14964AC8 200707070745
> http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
> -----BEGIN PGP SIGNATURE-----
>
> iD8DBQFGj30hvJuQZxSWSsgRA9iXAJ0aiS5oVbYxcY69yY0zvig4G4eBTwCdE5ON
> EYV77TeTYNSRt46fsZDfkTI=
> =C7mD
> -----END PGP SIGNATURE-----
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2007-07-07 20:39:44 Re: Arrays of records?
Previous Message rupesh bajaj 2007-07-07 19:53:22 Crash in PostgreSQL-8.2.4 while executing query