min() and max() with int8

From: Adam Buble <buble(at)academy(dot)cas(dot)cz>
To: pgsql-general(at)postgresql(dot)org
Subject: min() and max() with int8
Date: 1999-02-28 20:12:40
Message-ID: Pine.SO4.4.05.9902282100110.12615-100000@academy.cas.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
I have some troubles using MIN and MAX aggregation functions with int8
values. If values are small (?) the functions works well, but if the size
of the number grows, or is lower than zero, it does not work well.

Example:
=> CREATE TABLE INT8_TBL(q1 int8, q2 int8);
=> INSERT INTO INT8_TBL VALUES('123','456');
=> select min(q1) from INT8_TBL;
min
---
123
(1 row)

=> INSERT INTO INT8_TBL VALUES('-123','-456');
=> select min(q1) from INT8_TBL;
min
---
0
(1 row)

max works fine in this scenario, but it depends on values in table. Too
big numbers (but in int8 range) confuse Postgres as well.

What's wrong?

Adam

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Heflin 1999-02-28 20:29:53 Re: [GENERAL] Does PostgreSQL support a file load function
Previous Message Judy Dilworth 1999-02-28 20:01:19 Does PostgreSQL support a file load function