Why is DATESTYLE, ordering ignored for output but used for input ?

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Why is DATESTYLE, ordering ignored for output but used for input ?
Date: 2023-07-03 18:06:18
Message-ID: CADK3HH+Ev=ZM-mru1gRRBHy+ur54NcuFZNa_bHRgtUJP82YoGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

For ISO and German dates the order DMY is completely ignored on output but
used for input.

test=# set datestyle to 'ISO,DMY';
SET
select '7-8-2023'::date
test-# ;
date
------------
2023-08-07
(1 row)

test=# set datestyle to 'ISO,MDY';
SET
test=# select '7-8-2023'::date
;
date
------------
2023-07-08
(1 row)

Note regardless of how the ordering is specified it is always output as
YMD

Dave Cramer

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-07-03 18:19:14 Re: pgsql: Fix search_path to a safe value during maintenance operations.
Previous Message Tristan Partin 2023-07-03 17:54:50 Re: Optionally using a better backtrace library?