UPDATE Syntax Error

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: UPDATE Syntax Error
Date: 2011-02-04 20:51:23
Message-ID: alpine.LNX.2.00.1102041246270.9327@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

I _think_ today's the worst cold day and my head will clear from now on.
In the meantime, I'm not seeing why an UPDATE statement does not return the
number of updated rows.

The idea is to replace NULL values in the units column with 'mg/L':

jerrittwq=# update monitor set units = 'mg/L' where units = NULL;
UPDATE 0

and there should be several thousands of updated rows. I've also tried
specifying the units attribute as '' and ' ' with no better results. Should
be a simple statement and I'm not seeing why it fails.

FWIW, I tried specifying an alias for the table, but that barfed for a
different reason:

jerrittwq=# update monitor as m set m.units = 'mg/L' where m.units = NULL;
ERROR: column "m" of relation "monitor" does not exist
LINE 1: update monitor as m set m.units = 'mg/L' where m.units = NUL...

Clue stick, please,

Rich

Responses

Browse pdxpug by date

  From Date Subject
Next Message Tim Bruce 2011-02-04 20:52:07 Re: UPDATE Syntax Error
Previous Message Rich Shepard 2011-02-03 19:08:56 Re: More Cleanup Guidance Needed