0

I defined a new datatype, say

CREATE TABLE IF NOT EXISTS face_axis ( face INTEGER, normal real[]);

where normal should be a vector.

I have already write them on harddisk, like

5, 1,0,0,
....

Then I want to use

COPY face_axis FROM 'face_axis.csv' with csv;

but it reports error

ERROR:  extra data after last expected column

what's wrong with it? thanks,

1 Answer 1

4

There are two problems:

  1. The array contents must be enclosed in brackets in all cases
  2. Ambiguous use of comma as both the CSV delimiter and delimiter of values inside the array.

You may use a different CSV separator or quote the contents according to CSV rules:

To be loaded with COPY table FROM file with csv delimiter ';'

1;{1.0,2.0}

To be loaded with COPY table FROM file with csv

1,"{1.0,2.0}"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.