The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/9.5/static/sql-update.html Description: Does the Update command update the columns in the order they are listed? Can an updated column's new value be used in the value calculation for a subsequent column? i.e. update mytable set qty=qty+5,price=price*1.1,subtotal=qty*price Will the subtotal be calculated based on the old column values or the new column values?
simonwhite@dciphercomputing.com writes:
> Does the Update command update the columns in the order they are listed?
Notionally, they're all done concurrently. This is embodied in our
docs by defining the update source expressions thus:
An expression to assign to the column. The expression can use the
old values of this and other columns in the table.
> Can an updated column's new value be used in the value calculation for a
> subsequent column?
No, see above.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера