Re: Casting Integer to Boolean in assignment

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: Casting Integer to Boolean in assignment
Дата
Msg-id CAEzk6ff+5w_LUtanxoF8Q3up+_im4_97co=CAx=681k_KJUpiw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Casting Integer to Boolean in assignment  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
On Thu, 24 Jan 2019 at 12:17, Thomas Kellerer <spam_eater@gmx.net> wrote:
> Geoff Winkless schrieb am 24.01.2019 um 12:45:
> > My own opinion is that non-0 should implicitly cast as true and 0
> > should cast as false.
>
> I strongly disagree - that would mimic MySQL's idiosyncrasies and would make such a query valid:

Feel free. I said it's my own opinion and gave a way for someone who
agrees with me to do the same as I do.

If your objection is that someone can write a stupid query and it
might go wrong, there are a million other things that should be
addressed before implicit int::bool casts.

Geoff


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [pgbackrest] Expiring the last backup?
Следующее
От: Ron
Дата:
Сообщение: Re: [pgbackrest] Expiring the last backup?