Re: DATE type output does not follow datestyle parameter

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

On Tue, Aug 6, 2013 at 12:09:53PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Is this format so old that we can't fix this?
>
> Yes. I don't see any reason to change it, either, as nobody has
> complained that it's actually bad. If you feel a compulsion to
> change the docs, do that.

OK, seems 'Postgres' is a unique output format for 'date' too, even though
it doesn't look like the 'Postgres' timestamp output:

default
SET datestyle = 'ISO, MDY'; SELECT current_timestamp, current_date;
SET
now | date
-------------------------------+------------
2013-08-06 16:18:48.218555-04 | 2013-08-06

SET datestyle = 'SQL, MDY'; SELECT current_timestamp, current_date;
SET
now | date
--------------------------------+------------
08/06/2013 16:18:43.054488 EDT | 08/06/2013

SET datestyle = 'German, MDY'; SELECT current_timestamp, current_date;
SET
now | date
--------------------------------+------------
06.08.2013 16:18:59.026553 EDT | 06.08.2013

MDY
SET datestyle = 'Postgres, MDY'; SELECT current_timestamp, current_date;
SET
now | date
-------------------------------------+------------
Tue Aug 06 16:18:53.590548 2013 EDT | 08-06-2013

DMY
SET datestyle = 'Postgres, DMY'; SELECT current_timestamp, current_date;
SET
now | date
-------------------------------------+------------
Tue 06 Aug 16:20:23.902549 2013 EDT | 06-08-2013

I don't think there is even a documentation change I can suggest.

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

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karl O. Pinc 2013-08-06 21:03:13 Doc Patch: Subquery section to say that subqueries can't modify data
Previous Message Boszormenyi Zoltan 2013-08-06 19:52:52 Re: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])