Re: [BUGS] Possible regression in 'UPDATE ... SET () = ' with just one single column/row value since v10

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] Possible regression in 'UPDATE ... SET () = ' with just one single column/row value since v10
Дата
Msg-id 22434.1508854720@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] Possible regression in 'UPDATE ... SET () = ' with just one single column/row value since v10  (YasonTR <yasontr@protonmail.com>)
Ответы Re: [BUGS] Possible regression in 'UPDATE ... SET () = ' with just one single column/row value since v10
Список pgsql-bugs
YasonTR <yasontr@protonmail.com> writes:
> The following (odd) construction worked in pgv9.x: "UPDATE my_table SET (my_col) = (some value)". This no longer
worksin v10. It gives the error "source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression". It
lookslike it only breaks when the column list just holds one single column. 

Yeah, IIRC this was an intentional change.  The fact that the previous
coding allowed you to do that was a mistake, because per spec you really
need to supply a row value when you parenthesize the SET column list.
As of v10 it should work to write
UPDATE my_table SET (my_col) = ROW(some value)
        regards, tom lane


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: Pavel Suderevsky
Дата:
Сообщение: Re: [BUGS] BUG #14863: wrong reltuples statistics after vacuum without analyze
Следующее
От: YasonTR
Дата:
Сообщение: Re: [BUGS] Possible regression in 'UPDATE ... SET () = ' with just one single column/row value since v10