Bruno Lopes (Desenvolvimento) <blvieira(at)pcsolution(dot)com(dot)br> writes:
> CREATE FUNCTION test() RETURNS bool AS 'INSERT INTO b (nome) VALUES (\'PQP\');' LANGUAGE 'sql';
> function declared to return type bool, but final query is not a retrieve
> obviously my return type is incorrect... so what should I use?
It's unhappy because you're not returning anything (no final SELECT
statement).
You might consider updating to a more recent PG version; that error
message hasn't been worded that way for quite awhile.
regards, tom lane