Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA01933 for ; Sun, 11 Jul 1999 11:33:02 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from mx99.openu.ac.il (arbel.openu.ac.il [147.233.32.4]) by trends.net (8.8.8/8.8.8) with ESMTP id LAA02114 for ; Sun, 11 Jul 1999 11:04:11 -0400 (EDT) Received: from talmon.openu.ac.il (talmon.openu.ac.il [147.233.32.11]) by mx99.openu.ac.il (Postfix) with ESMTP for id D401F4B62D; Sun, 11 Jul 1999 17:57:27 +0300 (IDT) Received: from [147.233.159.109] (mac-herouth.pc.openu.ac.il) by talmon.openu.ac.il (Netscape Messaging Server 3.54) with ESMTP id AAA5A75; Sun, 11 Jul 1999 18:00:32 +0300 X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <3785BFF9.B569809@bull.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sun, 11 Jul 1999 17:57:33 +0300 To: Roland_DUBOULOZ , pgsql-sql@postgreSQL.org From: Herouth Maoz Subject: Re: [SQL] Bad date representation 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