Finding the number of rows affected by UPDATE or INSERT?

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: pgsql-general(at)postgresql(dot)org
Subject: Finding the number of rows affected by UPDATE or INSERT?
Date: 2001-08-30 05:57:22
Message-ID: 20010830055722.26740.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I am writing a bunch of stuff in pl/pgsql, and some of these functions
do UPDATEs or INSERTs on various tables. How could I find out, from
within the pl/pgsql function, how many rows were affected? This way,
if the update or insert fails for some reason, I can return a "failed"
message from the function, instead of pretending that everything is
ok.

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2001-08-30 06:36:29 Re: Finding the number of rows affected by UPDATE or INSERT?
Previous Message Stephan Szabo 2001-08-30 05:50:24 Re: Re: Referential Integrity problem...