Re: Support UPDATE table SET(*)=... - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Support UPDATE table SET(*)=...
Date
Msg-id CAHyXU0wicj-kpiO=Ytnha9Vb27j2Q9aH-ZuPLCa34jtfN1Ug+Q@mail.gmail.com
Whole thread Raw
In response to Re: Support UPDATE table SET(*)=...  (Marko Tiikkaja <marko@joh.to>)
Responses Re: Support UPDATE table SET(*)=...
Re: Support UPDATE table SET(*)=...
List pgsql-hackers
On Fri, Oct 17, 2014 at 9:55 AM, Marko Tiikkaja <marko@joh.to> wrote:
> On 10/17/14 4:15 PM, Merlin Moncure wrote:
>>
>> Any particular reason why you couldn't have just done:
>>
>> UPDATE table1 SET * = a,b,c, ...
>
>
> That just looks wrong to me.  I'd prefer  (*) = ..  over that any day.
>
>> UPDATE table1 t SET t = (SELECT (a,b,c)::t FROM...);
>>
>> seems cleaner than the proposed syntax for row assignment.  Tom
>> objected though IIRC.
>
> I don't know about Tom, but I didn't like that:
> http://www.postgresql.org/message-id/5364C982.7060003@joh.to

Hm, I didn't understand your objection:

<quoting>
So e.g.:  UPDATE foo f SET f = ..;

would resolve to the table, despite there being a column called "f"?
That would break backwards compatibility.
</quoting>

That's not correct: it should work exactly as 'select' does; given a
conflict resolve the field name, so no backwards compatibility issue.

merlin



pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: Support UPDATE table SET(*)=...
Next
From: Tom Lane
Date:
Subject: Re: Support UPDATE table SET(*)=...