[Q] Update from a table

Поиск
Список
Период
Сортировка
Искать

[Q] Update from a table

От:
Ladislav Lenart <lenartlad@volny.cz>
Дата:
Hello.

What happens if I issue UPDATE SET FROM... but with incomplete/buggy WHERE
condition and thus SEVERAL rows from the from_list match ONE row to update?

Thank you in advance,

Ladislav Lenart


Re: [Q] Update from a table

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Ladislav Lenart  writes:
> What happens if I issue UPDATE SET FROM... but with incomplete/buggy WHERE
> condition and thus SEVERAL rows from the from_list match ONE row to update?

Any given row will be updated at most once.  However, the from_list row
it gets updated against will be unpredictable, depending on the
implementation of the join.

			regards, tom lane

Re: [Q] Update from a table

От:
Ladislav Lenart <lenartlad@volny.cz>
Дата:
On 5.12.2013 15:14, Tom Lane wrote:
> Ladislav Lenart  writes:
>> What happens if I issue UPDATE SET FROM... but with incomplete/buggy WHERE
>> condition and thus SEVERAL rows from the from_list match ONE row to update?
> 
> Any given row will be updated at most once.  However, the from_list row
> it gets updated against will be unpredictable, depending on the
> implementation of the join.
> 
> 			regards, tom lane

Makes perfect sense.

Thank you,

Ladislav Lenart


FAQ