Is there a way to update non atomic values in Postgres? Example: update t3 set t3.fld[1] = 0 where t3.fld[1] = 5 ; The above example bombs every time. Any hints? Bob
Bob Kruger <bkruger@mindspring.com> writes:
> Is there a way to update non atomic values in Postgres?
> Example:
> update t3 set t3.fld[1] = 0 where t3.fld[1] = 5 ;
> ERROR: parser: parse error at or near "="
Bob, the correct syntax is
update t3 set fld[1] = 0 where t3.fld[1] = 5 ;
UPDATE doesn't allow explicit specification of the table containing
a field to be updated; you have to write just the field name before the
"=". The parser's error message about that could stand improvement...
There are a whole bunch of bugs associated with arrays :-(, but this
behavior isn't one of them. I hope to get some time to clean up the
array code for 6.6 or 6.7.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера