Re: Binary Format of Timestamp

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Binary Format of Timestamp
Дата
Msg-id 11303.1119939257@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Binary Format of Timestamp  (Joe Joe <fondwey@yahoo.com>)
Список pgsql-novice
Joe Joe <fondwey@yahoo.com> writes:
> I expect the timestamp format to be a float8 type
> containing the seconds elapsed sind the 1.1.2000. This
> should roughly be something around 172668107, give and
> take a few timezone adjustments. What i get back from
> PQgetvalue is the following array of bytes:

> 0: 0x00
> 1: 0x00
> 2: 0x9d
> 3: 0x0a
> 4: 0x6d
> 5: 0x2e
> 6: 0x88
> 7: 0xc0

Looks to me like you are talking to a server that's using the
integer_datetimes build option, in which the timestamp format
is int8 not double, and the unit is microseconds.

regression=# select x'9d0a6d2e88c0'::int8;
      int8
-----------------
 172668107000000
(1 row)

            regards, tom lane

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

Предыдущее
От: "Warren Murray"
Дата:
Сообщение: Fatal: password authentication failed for user "xxxxxx"
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Binary Format of Timestamp