From: | "Jean-Christophe Arnu" <jcarnu(at)gmail(dot)com> |
---|---|
To: | "David Tokmatchi" <david(dot)tokmatchi(at)gmail(dot)com> |
Cc: | pgsql-fr-generale(at)postgresql(dot)org |
Subject: | Re: Copy from : ERROR: date/time field value out of range |
Date: | 2007-07-30 15:05:39 |
Message-ID: | 5b3af220707300805h6ae4839pb8c639587e989f88@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-fr-generale |
Rebonjour,
c'est vrai qu'on peut également dire à PostgreSQL de changer son
parser de date :
SET datestyle Postgres, DMY
doit pouvoir vous sortir de ce problème. Sinon la lecture de
http://docs.postgresqlfr.org/7.4/datatype-datetime.html
http://docs.postgresqlfr.org/7.4/datetime-appendix.html
est très instructive.
--
Jean-Christophe Arnu
Le 30/07/07, David Tokmatchi<david(dot)tokmatchi(at)gmail(dot)com> a écrit :
>
>
> Bonjour
>
> J'utilise Copy pour charger les données depuis un fichier plat dans une
> table dont voici la description :
>
> Column | Type | Modifiers
> -----------+-----------------------------+-----------
> to_ref | bigint | not null
> to_entity | character(40) | not null
> to_date | timestamp without time zone | not null
> to_time | timestamp without time zone | not null
> to_occ | text |
>
> La commande copy est la suivante :
>
> copy toto from '/tmp/x.dat' delimiters '~'
>
> dans mon fichier x.dat il y a les données suivants ( un million
> d'enregistrement ):
> ...
> 3454495~TQKQD ~12.03.2007 00:00:00~01.01.1900 17:35:26~
> 3454496~HHKKF ~12.03.2007 00:00:00~01.01.1900 17:35:34~
> 3454497~BBIIL ~12.03.2007 00:00:00~01.01.1900 17:35:39~
> 3454501~IKKFFS ~12.03.2007 00:00:00~01.01.1900 17:43:16~
> 3454502~ADJUSTMENT ~12.03.2007 00:00:00~01.01.1900 17:44:33~
> 3454503~ADJUSTMENT ~12.03.2007 00:00:00~01.01.1900 17:46:16~
> 3454504~ADJUSTMENT ~12.03.2007 00:00:00~01.01.1900 17:47:52~
> 3454517~TFFFR ~13.03.2007 00:00:00~01.01.1900 08:53:20~
> ...
>
> L'erreur est la suivante :
> ERROR: date/time field value out of range: "13.03.2007 00:00:00"
> HINT: Perhaps you need a different "datestyle" setting.
> CONTEXT: COPY toto, line 89846, column to_date: " 13.03.2007 00:00:00"
>
> Pour info la ligne 89846 correspond a la dernière ligne de mes données.
>
> Merci pour vos lumières
From | Date | Subject | |
---|---|---|---|
Next Message | Dimitri Fontaine | 2007-07-30 15:06:44 | Re: Copy from : ERROR: date/time field value out of range |
Previous Message | Oliver Elphick | 2007-07-30 15:05:28 | Re: Copy from : ERROR: date/time field value out of range |