| От | Tom Lane |
|---|---|
| Тема | Re: Table Design: Timestamp vs time/date |
| Дата | |
| Msg-id | 25093.965582376@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Table Design: Timestamp vs time/date (Dale Walker <dale@icr.com.au>) |
| Список | pgsql-general |
Dale Walker <dale@icr.com.au> writes:
> Having a 'timestamp' field 'CCYY-MM-DD HH:MM:SS.SS' or two separate
> fields one for time 'HH:MM:SS.SS' and one for Date 'CCYY-MM-DD'.
Go for the timestamp. Otherwise you'll be cursing yourself the first
time someone wants to know about "all logins between noon Tuesday and
3am Thursday", for example --- easy with timestamps, a pain in the
neck without.
Even when the range boundaries do coincide with midnight, there isn't
likely to be any measurable performance advantage from using a date
column instead of a timestamp column.
Also, type timestamp is Postgres' best-supported date/time type, with
a more complete set of available operations than any of the secondary
date/time types.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера