Search Postgresql Archives

Re: Casting Integer to Boolean in assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/24/19 7:32 AM, Geoff Winkless wrote:
On Thu, 24 Jan 2019 at 15:28, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> 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?

Getting in a hurry/distracted.

I wrote out the above test case in psql and with tab completion it is easy to get to:

delete from delete_test where

and then forget the 'field =' part. Though my more common mistake along that line is:

delete from delete_test;

At any rate, if it can be done it will be done.


G



--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux