I have a function that updates several tables. As an example, let’s say it does something similar to:
UPDATE foo SET bar = some_value;
UPDATE boo SET far = another_value;
I would like to be able to see how many records are updated in each table. I know that I can display information with a Raise Notice, but don’t know how to get the number of records updated by each statement.
I’m using PostgreSQL 9.1
You need to use:
GET DIAGNOSTICS
For example (in your function):
I hope this helps.