Re: Casting Integer to Boolean in assignment - Mailing list pgsql-general

From Geoff Winkless
Subject Re: Casting Integer to Boolean in assignment
Date
Msg-id CAEzk6ff+5w_LUtanxoF8Q3up+_im4_97co=CAx=681k_KJUpiw@mail.gmail.com
Whole thread Raw
In response to Re: Casting Integer to Boolean in assignment  (Thomas Kellerer <spam_eater@gmx.net>)
List 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 by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [pgbackrest] Expiring the last backup?
Next
From: Ron
Date:
Subject: Re: [pgbackrest] Expiring the last backup?