Re: UPDATE syntax change

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Brusselback <adambrusselback(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: UPDATE syntax change
Date: 2017-10-30 16:42:46
Message-ID: 17451.1509381766@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adam Brusselback <adambrusselback(at)gmail(dot)com> writes:
> --works
> UPDATE tst_table
> SET (b, c) = ('help me', 'please')
> WHERE a = 0;
> --does not work
> UPDATE tst_table
> SET (b) = ('help me')
> WHERE a = 0;

> So there was a change made, and you now cannot use the multi-column
> syntax if you're only updating a single column. Was this intentional?

You still can, but you have to write ROW() explicitly. This conforms
to the standard, which our old behavior didn't.

It was probably an oversight not to list this change as a compatibility
issue. I'll go fix that ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2017-10-30 16:45:24 Re: gin index trouble
Previous Message Adam Brusselback 2017-10-30 16:42:31 Re: UPDATE syntax change (column-list UPDATE syntax fails with single column)