Re: Copy from : ERROR: date/time field value out of range

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
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:28
Message-ID: 1185807928.10580.46.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-fr-generale

On Mon, 2007-07-30 at 16:43 +0200, David Tokmatchi wrote:
> 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 ):
> ...
...
> 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

Tu dois dire à PostgreSQL d'utiliser des dates européennes. Il
interprète 13.03.2007 comme le troisième jour du treizième mois.

SET DATESTYLE TO 'Euro';

ou change DateStyle dans le fichier postgresql.conf.

--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
Do you want to know God? http://www.lfix.co.uk/knowing_god.html

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

In response to

Browse pgsql-fr-generale by date

  From Date Subject
Next Message Jean-Christophe Arnu 2007-07-30 15:05:39 Re: Copy from : ERROR: date/time field value out of range
Previous Message Jean-Paul Argudo 2007-07-30 15:02:45 Re: Reponse lente de postgres