Can you tell me the time?

Поиск
Список
Период
Сортировка
Искать

Can you tell me the time?

От:
Juan Manuel Sende <aliban@tiff93.es>
Дата:
I'm working on a database with time filed. so I insert data in this way 
hh:mm:ss.sss it's inserted okay but when i try to get a dum of the field i 
only get hh:mm:ss i've traid with libpq C interfrace, with php and of 
course with psql. ¿Any idea?

Re: Can you tell me the time?

От:
"Richard Huxton" <dev@archonet.com>
Дата:
From: "Juan Manuel Sende" 

> I'm working on a database with time filed. so I insert data in this way
> hh:mm:ss.sss it's inserted okay but when i try to get a dum of the field i
> only get hh:mm:ss i've traid with libpq C interfrace, with php and of
> course with psql. ¿Any idea?

Looks like you should get fractional seconds out if you put them in. As a
work-around you can use

date_trunc('milliseconds',mytime)

which will do what you want.

Note - pg_dump seems to only dump hh:mm:ss too, which probably moves this
from irritating to a bug. Unless somebody pipes up and says otherwise Juan,
you might want to fill in a bug report on this.

- Richard Huxton

FAQ