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
-----------------------------------------------------------------