"
I learned a lot: I like Postgres but the documentation sux (for example, in pl/pgsql how on earth do I find out 'how many rows affected' after an update? and use that a return value of the procedure). OpenACS is also somewhat lacking, but there are plenty of samples, so that wasn't too bad."
Use the get diagnostics command:
declare
my_row_count integer;
begin
update foo set bar = 'baz';
GET DIAGNOSTICS my_row_count = ROW_COUNT;
return my_row_count;
end;
See .../doc/postgresql/html/plpgsql-description.html in the pg documentation.