pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: CSV From Oracle with timestamp column getting errors
Date: Tue, 23 Mar 2021 07:56:42 +1100
Message-ID: <87lfaeq4p0.fsf@gmail.com> (raw)
In-Reply-To: <CAHty+vNygE5705DOE=AMk0uti=4MSbG61FErZFLMP-LJqvCW_w@mail.gmail.com>
References: <CAHty+vNygE5705DOE=AMk0uti=4MSbG61FErZFLMP-LJqvCW_w@mail.gmail.com>


"Saha, Sushanta K" <sushanta.saha@verizonwireless.com> writes:

> \COPY table1 FROM '/tmp/Oracle_2020_06.csv' DELIMITER ',' CSV HEADER;
> ERROR:  invalid input syntax for type timestamp: "01-JUN-20 06.04.20.634000 AM"
> CONTEXT:  COPY table1, line 2, column last_update_timestamp: "01-JUN-20 06.04.20.634000 AM"
>

The problem is psql doesn't understand/recognise the timestamp format
being used in the CSV dump from Oracle.

Modify the SQL used to extract the data from Oracle so that it formats
the timestamp as a string which psql can parse into a timestamp type -
for example ISO or any of the psql timestamp formats (see psql manual). 

-- 
Tim Cross





view thread (5+ messages)  latest in thread

Message-ID: <87lfaeq4p0.fsf@gmail.com>
Permalink:  ../87lfaeq4p0.fsf@gmail.com/
Also on:    postgresql.org/message-id/87lfaeq4p0.fsf@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: theophilusx@gmail.com
  Subject: Re: CSV From Oracle with timestamp column getting errors
  In-Reply-To: <87lfaeq4p0.fsf@gmail.com>
  References: <CAHty+vNygE5705DOE=AMk0uti=4MSbG61FErZFLMP-LJqvCW_w@mail.gmail.com> <87lfaeq4p0.fsf@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox