Date Problem on Imports to 7.2.1

From: "Geoff Ellis" <geoff(at)metalogicplc(dot)com>
To: "Pgsql-Admin (E-mail)" <pgsql-admin(at)postgresql(dot)org>
Subject: Date Problem on Imports to 7.2.1
Date: 2003-08-27 12:37:31
Message-ID: FDCF842C8B1DD311833C0090277C04B518C98D@augusta.planmatics.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

We have some date problems when importing data into the PSQL system. The
following example shows it happening:

Source file = spec.csv
2,1,08/06/99,29/07/99,1,1,A,'R' CONDITION,C,MA,,O,,,,,,,,,,WS000

When imported into Postgres, the data is shown as:
mss_live=# select id,cdate,mdate,code,type,category from spec_header limit 1
;
id | cdate | mdate | code | type
| category
----+------------------------+------------------------+---------------+-----
-+----------
2 | 1999-08-06 00:00:00+01 | 1999-07-29 00:00:00+01 | 'R' CONDITION | C
| MA
(1 row)

The data was imported with "copy table from 'path/to/file' delimiters ','
with '' as null.

As you can see, 08/06/99 (8th June 1999) has been converted to 1999-08-06
(6th August 1999), and 29/07/99 (29th July 1999) has been converted
correctly!

Is there a flag or setting within the database that will allow us to import
the date correctly?

thanks in anticipation..

Geoff Ellis

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Geoff Ellis 2003-08-27 12:39:19 Re: Date Problem on Imports to 7.2.1 [ SOLVED ]
Previous Message Bruno Wolff III 2003-08-27 12:24:46 Re: How to force an Index ?