Re: "Bad date external representation" - Mailing list pgsql-novice

From Tom Lane
Subject Re: "Bad date external representation"
Date
Msg-id 11363.1056061022@sss.pgh.pa.us
Whole thread Raw
In response to Re: "Bad date external representation"  (Lynna Landstreet <lynna@gallery44.org>)
Responses Re: "Bad date external representation"
List pgsql-novice
Lynna Landstreet <lynna@gallery44.org> writes:
> Some additional information with regard to this issue, in case it helps any.

Fooling around with this, I discovered that the datestyle setting *does*
make a difference --- which is surprising considering that this
particular date is quite non-ambiguous.  (There's a big flamewar in
progress right now on pgsql-general that presumes the present behavior
is to accept anything that is non-ambiguous.  Looks like we don't have
all our facts straight :-()

regression=# set datestyle = 'iso, us';
SET
regression=# select '9/19/2002'::date;
    date
------------
 2002-09-19
(1 row)

regression=# set datestyle = 'iso, euro';
SET
regression=# select '9/19/2002'::date;
ERROR:  Bad date external representation '9/19/2002'

So the answer is probably to make sure you have the US sub-mode
selected.

            regards, tom lane

pgsql-novice by date:

Previous
From: Chris Pizzo
Date:
Subject: [local] idle in transaction
Next
From: jean Bousquet
Date:
Subject: postmaster fatal error LC_TIME:fr when launching