Skip site navigation (1) Skip section navigation (2)

Re: Import CSV with Dates & Times

From: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Import CSV with Dates & Times
Date: 2012-05-04 13:38:59
Message-ID: CAMu32ADapkSiR5Eo=JzHPzMjHVp6PEYSYKTYjnC+r9MtKzcwSw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Just to report that I've realised what the problem was. PostgreSQL was
expecting the data in an american format of MM/DD/YYYY rather than the
UK version which is DD/MM/YYYY .



On 4 May 2012 13:31, James David Smith <james(dot)david(dot)smith(at)gmail(dot)com> wrote:
> Simon,
>
> Thanks for this. I don' t have pgloader installed and a quick search
> seems to suggest it's a Linux tool? I'm working in Windows
> unfortunately. Maybe a bit more info would be good...
>
> Here is my table:
>
> create table ibus_17_11_2011(
> route INTEGER,
> scheduled_depart_time TIMESTAMP
> )
>
> Here is my copy command:
>
> COPY ibus_17_11_2011 from 'C:/Program Files
> (x86)/PostgreSQL/8.4/data/ibus_17_11_2011_v2.csv' DELIMITERS ',' CSV;
>
> My date looks like this:
>
> 2  ,  17/11/2011 17:08:35
> 3  ,  17/11/2011 17:08:56
>
> Thanks
>
> James
>
>
>
> On 4 May 2012 12:47, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> On 4 May 2012 12:38, James David Smith <james(dot)david(dot)smith(at)gmail(dot)com> wrote:
>>
>>> Any sugestions please?
>>
>> Use pgloader
>>
>> --
>>  Simon Riggs                   http://www.2ndQuadrant.com/
>>  PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

pgsql-novice by date

Next:From: Ken BensonDate: 2012-05-04 13:42:47
Subject: Re: Import CSV with Dates & Times
Previous:From: James David SmithDate: 2012-05-04 12:31:38
Subject: Re: Import CSV with Dates & Times

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group