Re: update question - Mailing list pgsql-sql

From Tom Lane
Subject Re: update question
Date
Msg-id 26174.1133847937@sss.pgh.pa.us
Whole thread Raw
In response to Re: update question  (Matthew Peter <survivedsushi@yahoo.com>)
List pgsql-sql
Matthew Peter <survivedsushi@yahoo.com> 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
updatefrom 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


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Database query: Notification about change?
Next
From: Jenny
Date:
Subject: need help