Re: time format

Поиск
Список
Период
Сортировка
От Martin Marques
Тема Re: time format
Дата
Msg-id 1073274602.3ff8deeaeeeb5@bugs.unl.edu.ar
обсуждение исходный текст
Ответ на Re: time format  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Quoting Tom Lane <tgl@sss.pgh.pa.us>:

> Martin Marques <martin@bugs.unl.edu.ar> writes:
> > Look deeper into what Christopher said and use casting to get the right 
> > output:
> > prueba=> select now()::timestamp(0);
> 
> There's also "current_timestamp(0)", which is a more standards-compliant
> way of doing the same thing.

Didn´t know that existed. :-)

Anyway, my observation was not on the now() function, but at the casting. He
wants the output of th select over a timestamp field to come out without the
milliseconds, which is done with the casting.

Now, seeing your mail I realize that what he may want is this:

CREATE TABLE table_name (     .....     time_field   timestamp(0)
);

Remember you will lose those milliseconds for ever with this table definition.

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica                      Universidad Nacional
        del Litoral
 
-----------------------------------------------------------------


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

Предыдущее
От: A E
Дата:
Сообщение: Re: Anything akin to an Evaluate Statement in Postgresql?
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: [ADMIN] IEEE 754