Re:

From: Prakash Ramakrishnan <prakash(dot)ramakrishnan(dot)ap(at)nielsen(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re:
Date: 2019-07-02 08:02:27
Message-ID: CAA2eZXxS7y=Uzd_Fm8wOgf-hT5zC3+N63vwoSbD7PTC+PBtORQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks a lot. I will check and let you know.

Regards,
Prakash.R

On Tue, Jul 2, 2019 at 1:15 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Tue, 2019-07-02 at 13:09 +0530, Prakash Ramakrishnan wrote:
> > We are getting below error while during import the csv file please do
> the needful.
>
> I'd say the needful thing here is for you to read the documentation...
>
> > -bash-4.2$ more ckr_sto.csv
> > 4937880 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128790679 | | | |
> > 4939355 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128639345 | | | |
> > 4939744 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128684510 | | | |
> > 4939750 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128683100 | | | |
> > 4936360 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128567527 | | | |
> > 4940308 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128781329 | | | |
> > 4938006 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 4000128912554 | | | |
> > 4937457 | 12 | 2015-01-05 | | 2015-01-05 05:51:47 |
> | | 5000128426574 | | | |
> >
> > error
> > ----------
> > postgres=# \copy ckr_sto from /data/ckr_sto.csv CSV HEADER;
> > ERROR: invalid input syntax for integer: " 4939355 | 12 |
> 2015-01-05 | | 2015-01-05 05:51:47 | | |
> 5000128639345 | | | | "
> > CONTEXT: COPY ckr_sto, line 2, column pod_id: " 4939355 | 12 |
> 2015-01-05 | | 2015-01-05 05:51:47 | | |
> 500012863934..."
>
> From the documentation of COPY:
>
> DELIMITER
>
> Specifies the character that separates columns within each row (line)
> of the file.
> The default is a tab character in text format, a comma in CSV format.
> This must be a single one-byte character. This option is not allowed
> when using binary format.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>

--
Thanks,
Prakash.R
PostgreSQL - Offshore DBA support TCS / Nielsen Infrastructure Team On call
: +91-8939599426

In response to

  • Re: at 2019-07-02 07:45:03 from Laurenz Albe

Browse pgsql-general by date

  From Date Subject
Next Message Karl Martin Skoldebrand 2019-07-02 10:44:38 Sequences part 2
Previous Message Dirk Mika 2019-07-02 07:49:28 plpgsql: How to modify a field in an array of records