Re: rowcount - Mailing list pgsql-general

From Mike Mascari
Subject Re: rowcount
Date
Msg-id 3CD03BAB.E41BF3C1@mascari.com
Whole thread Raw
In response to rowcount  (Anna Dorofiyenko <anna.dorofiyenko@xdrive.com>)
List pgsql-general
> Anna Dorofiyenko wrote:
>
> Hello, list.
> How can I get in PL/pgSQL number of rows affected by insert/update?
>
> I'm looking to do something like:
> insert into...
> If rowcount>0
> then ...

I believe its GET DIAGNOSTICS:

GET DIAGNOSTICS rowcount = ROW_COUNT;

The docs seem pretty paltry on the subject, but here's a link:

http://www.postgresql.org/idocs/index.php?plpgsql-statements.html

>
> Thank you.
> Anna

pgsql-general by date:

Previous
From: elein
Date:
Subject: explain and explain analyze with functions
Next
From: "murphy pope"
Date:
Subject: Problem with cursors in PL/pgsql