Re: int4 <-> bool casts

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: int4 <-> bool casts
Дата
Msg-id 422266B2.6070206@samurai.com
обсуждение исходный текст
Ответ на int4 <-> bool casts  (Neil Conway <neilc@samurai.com>)
Ответы Re: int4 <-> bool casts  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
Peter Eisentraut wrote:
> - Casting back and forth does not preserve information.  (This may be
> true for some other type pairs as well, but in this case it's true in
> almost every instance.)

Right, there are many other explicit casts that lose information. In
fact, I think that's somewhat the point of an explicit cast -- if a cast
didn't lose information, it could be done implicitly. By explicitly
casting something, the user is acknowledging that they accept the
possibility of lost information.

> - It's an arbitary definition that is not obviously supported by
> mathematical or similar principles.

It has a long standing precedent outside of mathematics, such as in C
and derived programming languages.

-Neil

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: A way to let Vacuum warn if FSM settings are low.
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: int4 <-> bool casts