BUG #3475: SQL: 7/2 = 3

From: "vasile" <vasile(dot)halosta(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3475: SQL: 7/2 = 3
Date: 2007-07-20 07:34:59
Message-ID: 200707200734.l6K7Yx3t038881@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3475
Logged by: vasile
Email address: vasile(dot)halosta(at)gmail(dot)com
PostgreSQL version: 8.2.4
Operating system: Centos 4.4
Description: SQL: 7/2 = 3
Details:

When you divide 2 int the result is also int, is truncated:

On pgsql:
pg=# select 7/2;
?column?
----------
3
(1 row)

I know in c when you have to int operator the result is also int, but I
think this is not a good idea in SQL.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2007-07-20 08:07:43 Re: BUG #3475: SQL: 7/2 = 3
Previous Message Wiktor Wodecki 2007-07-20 06:38:10 Re: chr() function leads to OOM / killed connection with 8.1, 8.2