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

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: UPDATE statement with syntax error doesn't raise a warning?
Дата
Msg-id m3k4znrqpl.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на UPDATE statement with syntax error doesn't raise a warning?  (Mirko Pace <mirkop82@gmail.com>)
Список pgsql-general
Mirko Pace <mirkop82@gmail.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: UPDATE statement with syntax error doesn't raise a warning?
Следующее
От: David W Noon
Дата:
Сообщение: Re: UPDATE statement with syntax error doesn't raise a warning?