Re: [GENERAL] hrs, mins and seconds do not appear with to_char - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] hrs, mins and seconds do not appear with to_char
Date
Msg-id 24929.1503866124@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] hrs, mins and seconds do not appear with to_char  (Peter Koukoulis <pkoukoulis@gmail.com>)
Responses Re: [GENERAL] hrs, mins and seconds do not appear with to_char  (Peter Koukoulis <pkoukoulis@gmail.com>)
List pgsql-general
Peter Koukoulis <pkoukoulis@gmail.com> 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


pgsql-general by date:

Previous
From: Dmitry Igrishin
Date:
Subject: Re: [GENERAL] Using the dollar sign as a prefix for named parameterof prepared statement.
Next
From: Peter Koukoulis
Date:
Subject: Re: [GENERAL] hrs, mins and seconds do not appear with to_char