Re: formatting timestamptz for more precision?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: formatting timestamptz for more precision?
Дата
Msg-id 8887.1087868914@sss.pgh.pa.us
обсуждение исходный текст
Ответ на formatting timestamptz for more precision?  (Christopher.Becker@apcc.com)
Список pgsql-novice
Christopher.Becker@apcc.com writes:
>> From what I've read, Postgres stores plenty of precision to contain
> milliseconds.  My question is, how do I see the milliseconds?  Just doing a
> select on a timestamptz column just gives me hh:mm:ss... but i'm looking
> for something more like hh:mm:ss.ms.

Well, you can't see precision that isn't there.  How are you inserting
data?

The only way the column itself would be throwing away low-order digits
is if you declared it to, with a declaration like "timestamp(0)".
Example:

regression=# create table foo(f1 timestamptz);
CREATE TABLE
regression=# insert into foo values(now());
INSERT 155060 1
regression=# select * from foo;
              f1
-------------------------------
 2004-06-21 21:44:47.344823-04
(1 row)

regression=# create table bar (f1 timestamp(0) with time zone);
CREATE TABLE
regression=# insert into bar values(now());
INSERT 155063 1
regression=# select * from bar;
           f1
------------------------
 2004-06-21 21:46:36-04
(1 row)


            regards, tom lane

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

Предыдущее
От: Christopher.Becker@apcc.com
Дата:
Сообщение: formatting timestamptz for more precision?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: BUG #1176: PHP connection