Re: UPDATE statement with syntax error doesn't raise a warning?

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Mirko Pace <mirkop82(at)gmail(dot)com>, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: UPDATE statement with syntax error doesn't raise a warning?
Date: 2009-09-25 15:26:02
Message-ID: 4ABCE10A.2030103@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mirko Pace wrote:
> I've ran an update statement like this (obviously wrong, I know!):
>
> update my_table
> set boolean_field = true AND
> my_notes = 'something'
> where id in
> (select id from my_table order by random() limit 4000);
>
> in my psql client and I had a "UPDATE 4000" result but, correctly,
> anything was changed in my_table.
>
> So... why pg didn't raise a warning about syntax issue?
>
> Thank you!
>
> Mirko
>
> P.S.
> PostgreSQL 8.3.8 on i686-pc-linux-gnu, compiled by GCC gcc (Debian
> 4.3.2-1.1) 4.3.2
> psql 8.3.8 (Ubuntu package)

are you sure its wrong?

maybe pg looked at it like:
boolean_field = (true AND my_notes = 'something')

-Andy

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David W Noon 2009-09-25 15:36:43 Re: UPDATE statement with syntax error doesn't raise a warning?
Previous Message Tim Landscheidt 2009-09-25 15:25:58 Re: UPDATE statement with syntax error doesn't raise a warning?