Re: TODO for plpgsql: RETURN should accept arbitrary composite expressions

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TODO for plpgsql: RETURN should accept arbitrary composite expressions
Date: 2005-10-28 22:50:17
Message-ID: 200510281550.17595.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Folks,

Two corrections:

The second example was the wrong code, it should have been this function:

create function return_test_2 (
vuser INT, vsession INT
) returns return_value as $fnc$
begin
return row( -1, 'bad' );
end; $fnc$ language plpgsql;

Also, this issue is documented, but I believe that it still needs fixing,
as current behavior is cumbersome and unintuitive:

"When returning a scalar type, any expression can be used. The expression's
result will be automatically cast into the function's return type as
described for assignments. To return a composite (row) value, you must
write a record or row variable as the expression."

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-10-29 00:34:11 FKs on temp tables: hard, or just omitted?
Previous Message Josh Berkus 2005-10-28 22:41:38 TODO for plpgsql: RETURN should accept arbitrary composite expressions