plpgsql: numeric assignment to an integer variable errors out

Поиск
Список
Период
Сортировка
От Nikhil Sontakke
Тема plpgsql: numeric assignment to an integer variable errors out
Дата
Msg-id a301bfd90812110435l399acc41n6a74caa51f8ab229@mail.gmail.com
обсуждение исходный текст
Ответы Re: plpgsql: numeric assignment to an integer variable errors out  ("Nikhil Sontakke" <nikhil.sontakke@enterprisedb.com>)
Список pgsql-hackers
The following plpgsql function errors out with cvs head:<br /><br clear="all" />CREATE function test_assign() returns
void<br/>AS<br />$$ declare x int;<br />BEGIN<br />x := 9E3/2;<br />END<br />$$ LANGUAGE 'plpgsql';<br /><br
/>postgres=#select test_assign();<br /> ERROR:  invalid input syntax for integer: "4500.0000000000000000"<br
/>CONTEXT: PL/pgSQL function "test_assign" line 3 at assignment<br /><br />We do have an existing cast from numeric to
typeinteger. But here basically we convert the value to string in exec_cast_value before calling int4in. And then use
ofstrtol in pg_atoi leads to this complaint. Guess converting the value to string is not always a good strategy.<br
/><br/>Regards,<br />Nikhils <br />-- <br /><a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br /> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dmitry Turin
Дата:
Сообщение: Re: COCOMO & Indians
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: COCOMO & Indians