| От | Tom Lane |
|---|---|
| Тема | Re: update with from |
| Дата | |
| Msg-id | 29808.1327333859@sss.pgh.pa.us обсуждение |
| Ответ на | update with from (Sim Zacks <sim@compulab.co.il>) |
| Список | pgsql-general |
Sim Zacks <sim@compulab.co.il> writes:
> I want to update a table with a from that has mutliple rows joining to
> it. According to the docs, this is not advisable because:
> "If it does, then only one of the join rows will be used to update the
> target row, but which one will be used is not readily predictable."
That means exactly what it says.
> In my tests, if the joined rows are sorted it always updates with the
> first row. Does anyone have any other experiences, or should I be
> concerned that at some point it will behave differently?
If you rely on this, your code *will* break some day. Probably at
3AM while you're on vacation. All it takes is a plan change.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера