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

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE statement with syntax error doesn't raise a warning?
Date: 2009-09-25 15:25:58
Message-ID: m3k4znrqpl.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mirko Pace <mirkop82(at)gmail(dot)com> 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?

Because there is no syntax error? "TRUE AND my_notes =
'something'" is a valid expression (and equivalent to
"my_notes = 'something'").

Tim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2009-09-25 15:26:02 Re: UPDATE statement with syntax error doesn't raise a warning?
Previous Message Andy Colson 2009-09-25 15:22:57 Re: Delphi connection ?