Thread: Can you tell me the time?

Can you tell me the time?

From
Juan Manuel Sende
Date:
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?

From
"Richard Huxton"
Date:
From: "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?

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