date_trunc should be called date_round?
| От | Mario Splivalo |
|---|---|
| Тема | date_trunc should be called date_round? |
| Дата | |
| Msg-id | 4A487F94.3070303@megafon.hr обсуждение исходный текст |
| Ответы |
Re: date_trunc should be called date_round?
|
| Список | pgsql-sql |
It's stated in the docs that date_trunc is "conceptually similar to the
trunc function for numbers.".
So, trunc(1.1) = 1, trunc(1.9) = 1, and so on.
But, date_trunc behaves like round function: round(1.9) = 2.
Example:
idel=# select date_trunc('milliseconds', '2009-01-01
12:15:00.000999+02'::timestamp with time zone); date_trunc
----------------------------2009-01-01 11:15:00.001+01
(1 row)
fidel=# select version(); version
----------------------------------------------------------------------------------------------------------PostgreSQL
8.3.7on x86_64-unknown-linux-gnu, compiled by GCC
gcc-4.3.real (Ubuntu 4.3.3-5ubuntu4) 4.3.3
(1 row)
Or am I again completely misreading something?
Mike
В списке pgsql-sql по дате отправления: