Re: Casting Integer to Boolean in assignment

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Alexandre GRAIL <postgresql(dot)general(at)augure(dot)net>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Casting Integer to Boolean in assignment
Date: 2019-01-24 15:32:03
Message-ID: CAEzk6fdybWtW6KXrV0bjYY7=2jYDxY=nDmbZBxr4+F2hfBLhwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 24 Jan 2019 at 15:28, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
> On 1/24/19 7:21 AM, Geoff Winkless wrote:
> > How could you even write a query like the one Thomas posted? It
> > doesn't even look remotely sensible.

> delete from delete_test where 1::boolean;

*chuckle*

You misunderstand me.

I mean, how can one write a query like that by mistake?

DELETE FROM <tablename> WHERE <integer>;

What would you be thinking that that ought to do?

G

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Winkless 2019-01-24 15:36:13 Re: Casting Integer to Boolean in assignment
Previous Message Adrian Klaver 2019-01-24 15:30:19 Re: How duplicate values inserted into the primary key column of table and how to fix it