Re: possibly a bug?
От | Tom Lane |
---|---|
Тема | Re: possibly a bug? |
Дата | |
Msg-id | 27628.1012433266@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | possibly a bug? (Ewald Geschwinde <webmaster@geschwinde.net>) |
Список | pgsql-novice |
Ewald Geschwinde <webmaster@geschwinde.net> writes: > beta=# SELECT ('2001-10-28'::date + '1 day'::interval)::date; > ?column? > ------------ > 2001-10-28 > (1 row) Try using date arithmetic, rather than timestamp arithmetic: regression=# SELECT '2001-10-28'::date + 1; ?column? ------------ 2001-10-29 (1 row) The problem with the other is that type interval considers '1 day' to mean '24 hours', which is not what you want. Since 10/28 is a DST transition day (at least here in the USA), there's a difference. What you're really getting is a timestamp addition: regression=# SELECT ('2001-10-28'::date + '1 day'::interval); ?column? ------------------------ 2001-10-28 23:00:00-05 (1 row) which doesn't produce the desired result when you coerce the timestamp back to date. However, adding a plain integer to a date will do what you want. regards, tom lane
В списке pgsql-novice по дате отправления: