Re: [GENERAL] UPDATE syntax change

2017-10-30 Thread Tom Lane
Adam Brusselback 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 col

Re: [GENERAL] UPDATE syntax change (column-list UPDATE syntax fails with single column)

2017-10-30 Thread Adam Brusselback
Appreciate the link, didn't come up when I was googling the issue. As you said, a mention in the release notes would have been helpful. Thanks, -Adam -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

Re: [GENERAL] UPDATE syntax change (column-list UPDATE syntax fails with single column)

2017-10-30 Thread Justin Pryzby
On Mon, Oct 30, 2017 at 12:29:03PM -0400, Adam Brusselback wrote: > I have some queries that were working in 9.6 which suddenly broke when > moving to 10. > > Digging in, the error i'm getting is: ERROR: source for a > multiple-column UPDATE item must be a sub-SELECT or ROW() expression > So the

[GENERAL] UPDATE syntax change

2017-10-30 Thread Adam Brusselback
Hey all, just getting around to updating my development environment to Postgres 10, and there was something I found while in testing. Version info: PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18) 6.3.0 20170516, 64-bit I have some queries that were working in 9.6 which s

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread David Greco
>David Greco wrote: >[wants to use CTEs in an UPDATE] >> Yeah that's good, but there are plenty of columns, was hoping to be able to use (table.*) syntax >Is this a problem or do you just want to type as little as possible? >You have to specify them in the SET clause anyway. No problem, just l

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread Albe Laurenz
David Greco wrote: [wants to use CTEs in an UPDATE] > Yeah that's good, but there are plenty of columns, was hoping to be able to use (table.*) syntax Is this a problem or do you just want to type as little as possible? You have to specify them in the SET clause anyway. Yours, Laurenz Albe --

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread David Greco
Yeah that's good, but there are plenty of columns, was hoping to be able to use (table.*) syntax -Original Message- From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at] Sent: Friday, November 30, 2012 3:47 AM To: David Greco; pgsql-general@postgresql.org Subject: RE: [GENERAL] U

Re: [GENERAL] UPDATE syntax

2012-11-30 Thread Albe Laurenz
David Greco wrote: > Need some help with UPDATE syntax. I am attempting to do something like this: > > WITH default_facility AS ( > SELECT facility_id, > inkjetorlabel > FROM engagement_facility_defs > WHERE engagement_facility_def_id

[GENERAL] UPDATE syntax

2012-11-29 Thread David Greco
Need some help with UPDATE syntax. I am attempting to do something like this: WITH default_facility AS ( SELECT facility_id, inkjetorlabel FROM engagement_facility_defs WHERE engagement_facility_def_id = 8 ) UPDATE engagement_faciliti

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Tue, 12 Jun 2012, David Johnston wrote: And, to be thorough, you need to put commas between each field you want to update. Did that. Didn't write it that way in the message. Regards, Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your sub

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread David Johnston
On Jun 12, 2012, at 18:50, Rich Shepard wrote: > On Wed, 13 Jun 2012, Thomas Kellerer wrote: > >> UPDATE waterchem >> SET waterchem.easting = s.easting >> waterchem.northing = s.northing >> FROM sites AS s >> WHERE waterchem.site = s.name; > > Thomas, > > For the record, running this push

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Wed, 13 Jun 2012, Thomas Kellerer wrote: UPDATE waterchem SET waterchem.easting = s.easting waterchem.northing = s.northing FROM sites AS s WHERE waterchem.site = s.name; Thomas, For the record, running this pushed me to the correct syntax: UPDATE waterchem SET easting = s.e

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
On Wed, 13 Jun 2012, Thomas Kellerer wrote: No it's not quite correct: UPDATE waterchem SET waterchem.easting = s.easting waterchem.northing = s.northing FROM sites AS s WHERE waterchem.site = s.name; Thomas, I wondered about this syntax, and doing each column separately. Thanks for

Re: [GENERAL] UPDATE Syntax Check

2012-06-12 Thread Thomas Kellerer
Rich Shepard wrote on 13.06.2012 00:17: One table, waterchem, with primary key 'site' has columns easting and northing with no values in them. A second table, sites, with primary key 'name' has values for easting and northing for each row. I want to update waterchem with the easting and northi

[GENERAL] UPDATE Syntax Check

2012-06-12 Thread Rich Shepard
One table, waterchem, with primary key 'site' has columns easting and northing with no values in them. A second table, sites, with primary key 'name' has values for easting and northing for each row. I want to update waterchem with the easting and northing values from sites. My proposed statemen