Re: unable to read composite types from CSV files - Mailing list pgsql-novice

From David G. Johnston
Subject Re: unable to read composite types from CSV files
Date
Msg-id CAKFQuwYsaVkWhQTNVkMWWNCSimjK8hOz3eN_sVFfMezL-UkQ4w@mail.gmail.com
Whole thread Raw
In response to unable to read composite types from CSV files  ("Ian Bell" <ib@ianbellsoftware.com>)
Responses RE: unable to read composite types from CSV files
List pgsql-novice
On Thursday, April 19, 2018, Ian Bell <ib@ianbellsoftware.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.

pgsql-novice by date:

Previous
From: "Ian Bell"
Date:
Subject: unable to read composite types from CSV files
Next
From: "Ian Bell"
Date:
Subject: RE: unable to read composite types from CSV files