0

I've got a Postgres DB with a table named "precipitazione". What I want to do is update its column "quantita" when it shows a value of -9999. My statement :

 UPDATE precipitazione SET quantita = 0 WHERE quantita = -9999;

is not working(It is not working in the sense that the query won't be executed. It gives me a syntax error "near SET") I also tried to set "quantita" to DEFAULT (which is zero),but it's still not working.

SELECT * FROM precipitazione WHERE quantita = -9999;

is working.

Postgres VERSION: PostgreSQL 9.3.10

9
  • 2
    Not working is very vague. Commented Dec 9, 2015 at 16:29
  • It is not working in the sense that the query won't be executed. It gives me a syntax error. Commented Dec 9, 2015 at 16:46
  • There doesn't seem to be anything wrong with your update statement. Is this the only statement in the batch that you are trying to execute? Commented Dec 9, 2015 at 17:06
  • And what is the (exact) error? Commented Dec 9, 2015 at 17:06
  • 1
    If you are using phppgadmin this is a known bug. Your query is ok, try it in psql. Commented Dec 9, 2015 at 20:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.