Re: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type"
От | Marcel Asio |
---|---|
Тема | Re: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type" |
Дата | |
Msg-id | 272F3B22-DA0F-45D3-9714-3C7BD977A00F@redbet.com обсуждение исходный текст |
Ответ на | Re: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type" (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Function works in 8.4 but not in 9.0 beta2 "ERROR: structure of query does not match function result type"
|
Список | pgsql-bugs |
Hi Tom, Yes I managed to figured that out, but when was this changed?=20 It was working in 8.4 but not 9.0 and I could not find anything about this = in the release notes. On Jun 29, 2010, at 17:32 , Tom Lane wrote: > Marcel Asio <marcel.asio@redbet.com> writes: >> I've started testing our applications against PostgreSQL 9.0 beta2 and f= ound >> that this function now does not work anymore(rewritten to be as small and >> anonymous as possible) >> CREATE TYPE test_type AS( >> product text, >> amount numeric(30,4) >> ); >> CREATE FUNCTION test_func() RETURNS SETOF test_type AS $$ >> BEGIN >> RETURN QUERY SELECT 'test'::text, 30.2::numeric; >> END; >> $$ LANGUAGE plpgsql STABLE; >=20 > You need to actually coerce the 30.2 to numeric(30,4), not just numeric. > The former behavior wasn't self-consistent. >=20 > regards, tom lane Regards Marcel Asio Network & System Administrator Redbet Technology Mobile: +46 (0)709 13 04 01 Work: +46 (0)8 12 09 99 41 marcel.asio@redbet.com This e-mail may contain confidential and/or privileged information. If you = are not the intended recipient (or have received this e-mail in error) plea= se notify the sender immediately and destroy this e-mail. Any unauthorised = copying, disclosure or distribution of the material in this e-mail is stric= tly forbidden.
В списке pgsql-bugs по дате отправления: