pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedBad date representation
2+ messages / 2 participants
[nested] [flat]
* Bad date representation
@ 1999-07-09 09:25 Roland_DUBOULOZ <Roland.Dubouloz@bull.net>
0 siblings, 1 reply; 2+ messages in thread
From: Roland_DUBOULOZ @ 1999-07-09 09:25 UTC (permalink / raw)
To: pgsql-sql
Is there a bug in the postmaster ?
with -e option the date must be in European format
but with no options the date may be in European or American format !
create table FOO (date date);
1.- postmaster -i -o -e
insert into FOO values('20-06-1999');
insert into FOO values('06-21-1999');
we have a "Bad date external representation" that is true.
2.-postmaster -i
insert into FOO values('06-22-1999');
insert into FOO values('06-07-1999');
insert into FOO values('23-06-1999'); <---- no ERROR
WE Have NO ERROR !!!!! why ???
and on select * from FOO the result is
date
----------
06-22-1999
06-07-1999
06-23-1999
--
Roland Dubouloz BULL XS/BU
BULL SA mailto:Roland.Dubouloz@bull.net
1,Rue de Provence Phone :+33 (0)4 76 29 77 87
BP 208 Bullcom : 229-7787
38432 Echirolles CEDEX Office : A1-052
France Fax : +33 (0)4 76 29 70 02
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] Bad date representation
@ 1999-07-11 14:57 Herouth Maoz <herouth@oumail.openu.ac.il>
parent: Roland_DUBOULOZ <Roland.Dubouloz@bull.net>
0 siblings, 0 replies; 2+ messages in thread
From: Herouth Maoz @ 1999-07-11 14:57 UTC (permalink / raw)
To: Roland_DUBOULOZ <Roland.Dubouloz@bull.net>; pgsql-sql
At 12:25 +0300 on 09/07/1999, Roland_DUBOULOZ wrote:
> 2.-postmaster -i
>
> insert into FOO values('06-22-1999');
> insert into FOO values('06-07-1999');
> insert into FOO values('23-06-1999'); <---- no ERROR
> WE Have NO ERROR !!!!! why ???
>
> and on select * from FOO the result is
>
> date
> ----------
> 06-22-1999
> 06-07-1999
> 06-23-1999
The way Postgres parses dates is: first, see if there is more than one way
to interpret the date. If there is more than one way, use the DateStyle.
So, if it sees a date like 23-06-1999, there is only one way to interpret
it - that the 23 is the day, and the 06 is the month. In that case, this is
June 23rd, and everything is OK. But a date like 08-06-1999 could be either
August sixth or June eighth. In that case, it uses the DateStyle to
determine which.
This algorithm gives you some lenience.
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-07-11 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-09 09:25 Bad date representation Roland_DUBOULOZ <Roland.Dubouloz@bull.net>
1999-07-11 14:57 ` Herouth Maoz <herouth@oumail.openu.ac.il>
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