plpgsql doesn't coerce boolean expressions to boolean

Поиск
Список
Период
Сортировка
От Frank van Vugt
Тема plpgsql doesn't coerce boolean expressions to boolean
Дата
Msg-id 200309101524.59312.ftm.van.vugt@foxi.nl
обсуждение исходный текст
Список pgsql-general
Hi,

FWIW, I walked into this one when changing an int[ ] into a numeric(5,1)[ ] :


IF ( 0::int ) => interpreted as false

IF ( 0.0::numeric(5,1) ) => interpreted as true


Yes, there should have been used some expression that evaluated to a boolean
to begin with, but 'if (int)' is not all that uncommon ;-)

However, I expected the numeric to be coerced to integer, so the result in
itself did surprise me....





--
Best,




Frank.


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Constructing column from different individual fields in same row.
Следующее
От: "Jules Alberts"
Дата:
Сообщение: help with TCL function