database - Using return query in Postgres 9.0 function with composite type -
I have a function in Postgres that returns a set of the entire set when I return only with This works for me, also in Postgres 8.4: You can create pre> Your origin should only return an exception, because due to type mismatch, you need string literals inserted for mailing types. On the other hand, the column nickname Here are irrelevant: The function is not visible outside the body. I am able to return to next; but with
return query command, why is
create type return_type? AS (Paramayam characters vary, value character is different); - This returning rows two rows can make r.paramname just works fine or the function test replaces (i_param1 character separately, i_param2 character different) SETOF returns_type: = 'ROW1'; R.value: = 'myvalue1'; Go ahead r; R.paramname: = 'ROW1'; R.value: = 'myvalue1'; Go ahead r; Return; - With this command I get the same line of the resultet return query, select 'ROW1' as the paraName value unions do not get all the 'line 2' as 'myvalue1' in the form of paraName, the value of 'Myvalue2' in the form; Return; "Text" itemprop = "text">
or change function function (i_param1 varchar, i_param2 varchar) instead of SETOF return_type $ function $ start return query select 'ROW1' :: varchar, 'myvalue1' :: varchar unions all 'Row2', 'myvalue2'; End $ $ func $ LANGUAGE plpgsql;
Comments
Post a Comment