Re: unable to read composite types from CSV files

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "ib(at)ianbellsoftware(dot)com" <ib(at)ianbellsoftware(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: unable to read composite types from CSV files
Date: 2018-04-20 00:34:08
Message-ID: CAKFQuwYsaVkWhQTNVkMWWNCSimjK8hOz3eN_sVFfMezL-UkQ4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thursday, April 19, 2018, Ian Bell <ib(at)ianbellsoftware(dot)com> wrote:
>
> 2) If composite types can indeed be read/imported from CSV files
> then would you please take a look at the sample code/data provided below
> and tell me why it generates the error message ‘extra data after last
> expected column’. In other words, what am I doing wrong?
>
>
> *Test CSV file contents*
>
> The contents of the CSV file (i.e. ‘testComposite.csv’) is:
>
>
>
> (1,2,3)
>
> (4,5,6)
>
> (7,8,9)
>
>
>
Your csv data contains commas. In order to treat them as data instead of
structure you have to double-quote the field/value containing the affected
data.

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ian Bell 2018-04-20 00:56:33 RE: unable to read composite types from CSV files
Previous Message Ian Bell 2018-04-20 00:24:35 unable to read composite types from CSV files