Search Postgresql Archives

Re: hrs, mins and seconds do not appear with to_char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




thanks. didn't realise they were different. I discovered the difference when using a MD5 comparison between the 2 databases in a C++ utility.
All  values were matching apart from dates.

Cheers
P

On Sun, 27 Aug 2017 at 21:35 Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Peter Koukoulis <pkoukoulis@xxxxxxxxx> writes:
> I am unsure as to why the hrs, mins and seconds do not appear for a date
> column.

Uh, because it's a date.

> When performing the exact same queries in Oracle, I get the full date
> formatted to "yyyymmddhh24miss", but cannot get the same for PostgreSQL,
> for example:

Oracle has a nonstandard notion of what "date" means, I believe.  You
probably want to use type "timestamp", and the to_timestamp() function,
in PG if you want behavior similar to what Oracle is doing.

https://www.postgresql.org/docs/current/static/datatype-datetime.html

                        regards, tom lane

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux