pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6113: SET DATESTYLE='European' does not set datestyle output correctly
2+ messages / 2 participants
[nested] [flat]
* BUG #6113: SET DATESTYLE='European' does not set datestyle output correctly
@ 2011-07-12 04:32 David Carlos Manuelda <StormByte@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: David Carlos Manuelda @ 2011-07-12 04:32 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged online:
Bug reference: 6113
Logged by: David Carlos Manuelda
Email address: StormByte@gmail.com
PostgreSQL version: 9.0.4
Operating system: Gentoo Linux
Description: SET DATESTYLE='European' does not set datestyle output
correctly
Details:
According to Doc (http://www.postgresql.org/docs/7.2/static/sql-set.html),
there are different datestyles available to format date outputs.
But either is a bug in doc or is a bug in postgre itself, but 'European'
does not currently do what it is intended (it does nothing actually).
From documentation:
Testcase 1: OK
German
Use dd.mm.yyyy for numeric date representations.
SET DATESTYLE='German';
SELECT NOW()::DATE;
now
------------
12.07.2011
Testcase 2: FAIL!
SET DATESTYLE='European';
SELECT NOW()::DATE;
now
------------
12.07.2011
As you can see, SET DATESTYLE='European' just did nothing and did not change
it from last set which was 'German', and of course, it does not even outputs
what was expected and stated in documentation.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #6113: SET DATESTYLE='European' does not set datestyle output correctly
@ 2011-07-12 11:34 Bernd Helmle <mailings@oopsware.de>
parent: David Carlos Manuelda <StormByte@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Bernd Helmle @ 2011-07-12 11:34 UTC (permalink / raw)
To: David Carlos Manuelda <StormByte@gmail.com>; pgsql-bugs
--On 12. Juli 2011 04:32:11 +0000 David Carlos Manuelda <StormByte@gmail.com>
wrote:
>
> The following bug has been logged online:
>
> Bug reference: 6113
> Logged by: David Carlos Manuelda
> Email address: StormByte@gmail.com
> PostgreSQL version: 9.0.4
> Operating system: Gentoo Linux
> Description: SET DATESTYLE='European' does not set datestyle output
> correctly
> Details:
>
> According to Doc (http://www.postgresql.org/docs/7.2/static/sql-set.html),
> there are different datestyles available to format date outputs.
This is a very outdated documentation link, you should refer to the 9.0
documentation instead:
<http://www.postgresql.org/docs/9.0/static/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT;
> But either is a bug in doc or is a bug in postgre itself, but 'European'
> does not currently do what it is intended (it does nothing actually).
>
[...]
> As you can see, SET DATESTYLE='European' just did nothing and did not change
> it from last set which was 'German', and of course, it does not even outputs
> what was expected and stated in documentation.
'European' or 'Euro' is just another way to write 'DMY' as an input format for
the date part. At least, for me it works as expected:
SET datestyle TO 'ISO, mdy';
SELECT '27.12.2011'::date;
ERROR: 22008: date/time field value out of range: "27.12.2011" at character 8
HINT: Perhaps you need a different "datestyle" setting.
LOCATION: DateTimeParseError, datetime.c:3541
STATEMENT: SELECT '27.12.2011'::date;
ERROR: date/time field value out of range: "27.12.2011"
LINE 1: SELECT '27.12.2011'::date;
^
HINT: Perhaps you need a different "datestyle" setting.
SET datestyle TO 'European';
SHOW datestyle;
DateStyle
-----------
ISO, DMY
(1 row)
SELECT '27.12.2011'::date;
date
------------
2011-12-27
(1 row)
--
Thanks
Bernd
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-07-12 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 04:32 BUG #6113: SET DATESTYLE='European' does not set datestyle output correctly David Carlos Manuelda <StormByte@gmail.com>
2011-07-12 11:34 ` Bernd Helmle <mailings@oopsware.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox