Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group