"Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br> writes:
> But if I create a function like:
> create function inserttest() returns void as ' insert into table1
> values(1, 1)' language 'sql';
> and I do a select * from inserttest();
> I can't get the CompletedResponse saying one row was affected :(
Why should you? What you executed was a SELECT. What the function does
internally is no business of yours.
You could define the function as returning the information you would
like to have the client app know. I don't think there is any way to get
at the rowcount in a SQL-language function, but most of the PL languages
have a mechanism for it, e.g. GET DIAGNOSTICS integer_var = ROW_COUNT;
in plpgsql.
regards, tom lane