Re: Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2. - Mailing list pgsql-bugs

From Jord Tanner
Subject Re: Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2.
Date
Msg-id 1063224971.4405.34.camel@gecko
Whole thread Raw
In response to Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2.  (Torello Querci <querci@negens.com>)
Responses Re: Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
This is not a bug, but simply due to postgres date formatting. Observe
thus:


gbi=# set datestyle to 'iso';
SET
gbi=# select to_date('03/06/1973','dd/mm/yyyy');
  to_date
------------
 1973-06-03
(1 row)

gbi=# set datestyle to 'us';
SET
gbi=# select to_date('03/06/1973','dd/mm/yyyy');
  to_date
------------
 1973-06-03
(1 row)

gbi=# set datestyle to 'sql';
SET
gbi=# select to_date('03/06/1973','dd/mm/yyyy');
  to_date
------------
 06/03/1973
(1 row)


datestyle can be permanently set in postgresql.conf, or by the
environment variable 'PG_DATESTYLE';

On Wed, 2003-09-10 at 03:52, Torello Querci wrote:
> Hi to all,
>
> I have a problem storing 1973/06/03 date.
>
> If I send this statement
>
>     select to_date('03/06/1973','dd/mm/yyyy');
>
> in the psql interface I obtain
>
>  to_date
> ------------
>  1973-06-02
>
> I test this statement with Postgres 7.3.2 and 7.3.4 packaged withMandrake 9.1
> and Mandrake 9.2RC1 and obtain the same result.
>
> Can anyone help me?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
--
Jord Tanner <jord@indygecko.com>

pgsql-bugs by date:

Previous
From: Theodore Petrosky
Date:
Subject: the OS X december update saga....
Next
From: Tom Lane
Date:
Subject: Re: Date 1973/06/03 Conversion Problem in 7.3.4 and 7.3.2.