min() and max() with int8

Поиск
Список
Период
Сортировка
От Adam Buble
Тема min() and max() with int8
Дата
Msg-id Pine.SO4.4.05.9902282100110.12615-100000@academy.cas.cz
обсуждение исходный текст
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Judy Dilworth
Дата:
Сообщение: Does PostgreSQL support a file load function
Следующее
От: buble@academy.cas.cz (Adam Buble)
Дата:
Сообщение: min() and max() with int8