test if update statement did anything in a transaction? - Mailing list pgsql-novice

From kg@kgb.une.edu.au (Klint Gore)
Subject test if update statement did anything in a transaction?
Date
Msg-id 8b4d3c7a.0311021805.6e57c060@posting.google.com
Whole thread Raw
List pgsql-novice
Is it possible to check if an update statement did anything in a
transaction?

ie
  begin;
  update table set intfield = intfield+1 where intfield >= 1;
  case rowsaffected > 0
     raise error;
  end;
  insert into table (intfield) values (1);
  commit;

in plpgsql there's the found variable to test.  is there an equivalent
in a transaction?

TIA,

klint.

pgsql-novice by date:

Previous
From: Antonios Christofides
Date:
Subject: Surrogate vs natural keys (Was: Almost relational PostgreSQL (was: one-to-one))
Next
From: chameenz@yahoo.com (Matthew Cimino)
Date:
Subject: Re: 1-2 second delay on all commands over network