[Q] Update from a table

Started by Ladislav Lenartover 12 years ago3 messagesgeneral
Jump to latest
#1Ladislav 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

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ladislav Lenart (#1)
Re: [Q] Update from a table

Ladislav Lenart <lenartlad@volny.cz> 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

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

#3Ladislav Lenart
lenartlad@volny.cz
In reply to: Tom Lane (#2)
Re: [Q] Update from a table

On 5.12.2013 15:14, Tom Lane wrote:

Ladislav Lenart <lenartlad@volny.cz> 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

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