X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3DBB39DCC4C for ; Tue, 6 Dec 2005 01:45:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45460-06 for ; Tue, 6 Dec 2005 01:45:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 14C579DCC3B for ; Tue, 6 Dec 2005 01:45:41 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jB65jb1Q026175; Tue, 6 Dec 2005 00:45:37 -0500 (EST) To: Matthew Peter cc: Jaime Casanova , pgsql-sql@postgresql.org Subject: Re: update question In-reply-to: <20051205234123.82345.qmail@web35208.mail.mud.yahoo.com> References: <20051205234123.82345.qmail@web35208.mail.mud.yahoo.com> Comments: In-reply-to Matthew Peter message dated "Mon, 05 Dec 2005 15:41:23 -0800" Date: Tue, 06 Dec 2005 00:45:37 -0500 Message-ID: <26174.1133847937@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.003 required=5 tests=[AWL=0.003] X-Spam-Score: 0.003 X-Spam-Level: X-Archive-Number: 200512/35 X-Sequence-Number: 23577 Matthew Peter writes: > it's in a loop so there's an extra comma at the end so i was thinking i could put in a throw away value to keep the update from breaking if there's an additional comma The best thing is to fix your loop logic. Usually it's not hard to emit a comma only if one is needed. If you're intent on using a broken loop, you could do "foo = foo" where foo is any table column you didn't yet assign to. Consider though the corner case where you've already assigned all the columns. Best bet is to fix your loop... regards, tom lane