Vincenzo Romano <vincenzo.romano@notorand.it> writes:
> CREATE OR REPLACE FUNCTION afun1( OUT ot TEXT )
> RETURNS SETOF RECORD
> The error message for afun1() reads:
> ERROR: function result type must be text because of OUT parameters
Indeed. It's trying to protect you from simple typos.
If you want a consistent syntax I'd suggest
CREATE OR REPLACE FUNCTION afun1() RETURNS TABLE (ot text) ...
It's still really "setof text" under the hood.
regards, tom lane