Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone
Дата
Msg-id AANLkTimUiEEeRntWcgJAoC3p6ndXBW8fxJ+m4PfyZC5C@mail.gmail.com
обсуждение исходный текст
Ответ на Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, Sep 3, 2010 at 3:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Wow.  You must have gotten those with the help of some arithmetic,
> because timestamptzin would never have produced them.  I found out I can
> do
>
> regression=# select extract(epoch from ('2000-01-01 00:00:00'::timestamptz +
'0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001'::interval)
-'2000-01-01 00:00:00'); 
>  date_part
> -----------
>    1e-209
> (1 row)
>
> but I wonder what it was you actually did.

I wonder myself :-) I encountered these timestamps while going through
some C code I inherited which uses libpq to load several tables (such
as myschema.strange_table in the original example) using COPY FROM
STDIN. I don't think any timestamp arithmetic was involved. The code
was supposed to copy in legitimate timestamps, but instead loaded all
these '1999-12-31 19:00:00-05' values, and I'm still trying to figure
out how/why.

Josh

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone
Следующее
От: Tom Lane
Дата:
Сообщение: Re: funkiness with '1999-12-31 19:00:00-05'::timestamp with time zone