Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E3B46B5DC72 for ; Tue, 12 Jul 2011 08:35:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 09541-02 for ; Tue, 12 Jul 2011 11:34:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from dd2030.kasserver.com (dd2030.kasserver.com [85.13.128.37]) by mail.postgresql.org (Postfix) with ESMTP id 71CE0B5DBE8 for ; Tue, 12 Jul 2011 08:34:56 -0300 (ADT) Received: from [172.26.14.86] (exit.credativ.com [87.139.82.80]) by dd2030.kasserver.com (Postfix) with ESMTPA id DC3DEE012D; Tue, 12 Jul 2011 13:34:53 +0200 (CEST) Date: Tue, 12 Jul 2011 13:34:52 +0200 From: Bernd Helmle To: David Carlos Manuelda , pgsql-bugs@postgresql.org Subject: Re: BUG #6113: SET DATESTYLE='European' does not set datestyle output correctly Message-ID: <111910B9C47F9E5CA25F3F78@apophis.local> In-Reply-To: <201107120432.p6C4WBZJ035452@wwwmaster.postgresql.org> References: <201107120432.p6C4WBZJ035452@wwwmaster.postgresql.org> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/98 X-Sequence-Number: 30710 --On 12. Juli 2011 04:32:11 +0000 David Carlos Manuelda 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: > 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