BUG #2003: Bug with SQL UPDATE on a NUMERIC

From: "David Pujol" <dpujol(at)toulouse(dot)inra(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2003: Bug with SQL UPDATE on a NUMERIC
Date: 2005-10-27 09:39:15
Message-ID: 20051027093915.C92EFF0F70@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2003
Logged by: David Pujol
Email address: dpujol(at)toulouse(dot)inra(dot)fr
PostgreSQL version: 8.0 and 7.4
Operating system: Windows and linux
Description: Bug with SQL UPDATE on a NUMERIC
Details:

Hello, I've noticed a bug when I modify a quantity with an INSERT and a
minus operator.
My request is:
UPDATE products SET pr_stock=pr_stock--1 WHERE pr_code=600;

I haven't SQL error but 'pr_stock' value (numeric(5,1)) is unchanged : no
increment or decrement.

I've made tests:
- 'pr_stock=pr_stock +- 1' is OK (substraction -1)
- 'pr_stock=pr_stock ++ 1' is OK ( +1)
- 'pr_stock=pr_stock -+ 1' is OK ( -1)
- 'pr_stock=pr_stock -- 1' is not OK (no change, no error)

Same things with brackets :
- 'pr_stock=pr_stock +(- 1)' is OK (substraction -1)
- 'pr_stock=pr_stock +(+ 1)' is OK ( +1)
- 'pr_stock=pr_stock -(+ 1)' is OK ( -1)
- 'pr_stock=pr_stock -(- 1)' is not OK (no change, no error)

This bug report is for Windows XP + Postresql 8.0 and for Linux + Postgresql
7.4

PS : Sorry for my english ; I'm french!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-10-27 13:44:13 Re: Inconsistent description of "postmaster.opts"
Previous Message Qingqing Zhou 2005-10-27 07:33:11 Inconsistent description of "postmaster.opts"