On Wed, Oct 15, 2014 at 3:48 AM, Atri Sharma <[email protected]> wrote: > > > On Wednesday, October 15, 2014, Marti Raudsepp <[email protected]> wrote: >> >> Hi >> >> On Wed, Oct 15, 2014 at 11:02 AM, Atri Sharma <[email protected]> wrote: >> > Please find attached a patch which implements support for UPDATE table1 >> > SET(*)=... >> >> I presume you haven't read Tom Lane's proposal and discussion about >> multiple column assignment in UPDATE: >> http://www.postgresql.org/message-id/[email protected] >> (Assigning all columns was also discussed there) >> >> And there's a WIP patch: >> http://www.postgresql.org/message-id/[email protected] > > Thanks for the links, but this patch only targets SET(*) case, which, if I > understand correctly, the patch you mentioned doesn't directly handle (If I > understand correctly, the target of the two patches is different).
Yeah -- in fact, there was some discussion about this exact case. This patch solves a very important problem: when doing record operations to move data between databases with identical schema there's currently no way to 'update' in a generic way without building out the entire field list via complicated and nasty dynamic SQL. I'm not sure about the proposed syntax though; it seems a little weird to me. Any particular reason why you couldn't have just done: UPDATE table1 SET * = a,b,c, ... also, UPDATE table1 t SET t = (SELECT (a,b,c)::t FROM...); seems cleaner than the proposed syntax for row assignment. Tom objected though IIRC. merlin -- Sent via pgsql-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
