Re: DATE type output does not follow datestyle parameter

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: DATE type output does not follow datestyle parameter
Date: 2013-12-02 16:52:43
Message-ID: 20131202165243.GD5274@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 2, 2013 at 10:22:47PM +0900, MauMau wrote:
> I'm sorry I didn't respond for a long time. I've come up with a suggestion.
>
> The original reporter of this problem expected the output of the
> date type in 'Postgres,DMY' style to be "17 Dec 1997", when the
> output of the timestamp if "Wed 17 Dec 07:37:16 1997 PST". He
> thought so by reading the following sentence:
>
> http://www.postgresql.org/docs/current/static/datatype-datetime.html
> The output of the date and time types is of course only the date or
> time part in accordance with the given examples.
>
> However, the actual output of the date type in Postgres style is:
>
> * 12-17-1997 if datestyle is 'Postgres,YMD' or 'Postgres,MDY'
> * 17-12-1997 if datestyle is 'Postgres,DMY'
>
> So, my suggestion is to just add the following sentence right after
> the above one.
>
> The Postgres style is an exception: the output of the date type is
> either MM-DD-YYYY (e.g. 12-17-1997) or DD-MM-YYYY (e.g. 17-12-1997),
> which is different from the date part of the output of the timestamp
> type.
>
> Could you consider and add this to the manual?

Yes, I will make the change unless someone objects.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-12-02 17:07:12 Re: Proposed feature: Selective Foreign Keys
Previous Message Bruce Momjian 2013-12-02 16:41:10 Re: [GENERAL] pg_upgrade ?deficiency