Chapman Flack <c...@anastigmatix.net> writes:
> The same declaration can be changed to have just one OUT parameter:

> CREATE FUNCTION dup(in int, out f text)
>     AS $$ SELECT CAST($1 AS text) || ' is text' $$
>     LANGUAGE SQL;

> But it then behaves as a function returning a text scalar, not a record.

Yup, that's intentional, and documented.  It seems more useful to allow
you to declare a scalar-returning function in this style, if you wish,
than to make it mean a one-component record.  If you really want a
one-component composite type, you can declare such a type explicitly
and return that.

                        regards, tom lane


Reply via email to