| От | Karsten Hilbert |
|---|---|
| Тема | Re: [8.1.4] Create index on timestamp fails |
| Дата | |
| Msg-id | 20060823135527.GI5940@merkur.hilbert.loc обсуждение |
| Ответ на | Re: [8.1.4] Create index on timestamp fails (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
On Wed, Aug 23, 2006 at 09:42:00AM -0400, Tom Lane wrote:
> It sounds a bit bogus to me too. Another possibility is to keep the
> data storage as timestamptz (which is really the recommended type for
> any sort of real time values), and define the index on
>
> date_part('day', entry_time AT TIME ZONE 'GMT')
That definitely sounds reasonable.
> (or whatever zone you choose to use for reference). However, to use the
> index you'd have to spell the queries exactly like that, so the PITA
> factor might be too high.
An SQL function "gmt_tz(timestamptz)" might help to cut down
on the fuss:
select ... from tbl where gmt_tz(tbl.a_tz) between ...;
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера