Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA56649; Sat, 12 Jun 1999 18:36:56 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id SAA23823; Sat, 12 Jun 1999 18:36:19 -0400 (EDT) To: Bob Kruger cc: pgsql-sql@postgreSQL.org, pgsql-general@postgreSQL.org Subject: Re: [SQL] Updating non atomic values In-reply-to: Your message of Tue, 08 Jun 1999 12:27:30 -0500 <3.0.5.32.19990608122730.007b4d50@mindspring.com> Date: Sat, 12 Jun 1999 18:36:19 -0400 Message-ID: <23821.929226979@sss.pgh.pa.us> From: Tom Lane Bob Kruger writes: > Is there a way to update non atomic values in Postgres? > Example: > update t3 set t3.fld[1] = 0 where t3.fld[1] = 5 ; > ERROR: parser: parse error at or near "=" Bob, the correct syntax is update t3 set fld[1] = 0 where t3.fld[1] = 5 ; UPDATE doesn't allow explicit specification of the table containing a field to be updated; you have to write just the field name before the "=". The parser's error message about that could stand improvement... There are a whole bunch of bugs associated with arrays :-(, but this behavior isn't one of them. I hope to get some time to clean up the array code for 6.6 or 6.7. regards, tom lane