BUG #4515: UPDATE strange behavior

Started by xtronover 17 years ago2 messagesbugs
Jump to latest
#1xtron
xtronz@yandex.ru

The following bug has been logged online:

Bug reference: 4515
Logged by: xtron
Email address: xtronz@yandex.ru
PostgreSQL version: 8.3.5
Operating system: Debian GNU/Linux
Description: UPDATE strange behavior
Details:

IMHO this is strange behavior:

create table a1(id int, value int);
create table a2(id int, value int);

this is work:
update a1 set value = a2.value from a2 where a1.id = a2.id;

this is NOT work:
update a1 set a1.value = a2.value from a2 where a1.id = a2.id;

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: xtron (#1)
Re: BUG #4515: UPDATE strange behavior

"xtron" <xtronz@yandex.ru> writes:

this is NOT work:
update a1 set a1.value = a2.value from a2 where a1.id = a2.id;

This syntax is disallowed by the SQL standard: a SET target is just the
name of the column. If we tried to interpret it as you suggest then
we'd be incompatible for composite-type columns.

regards, tom lane