Readers,

This is for other novices that experienced the same error. Solved by
expert postgresql users at the irc channel.

I created a database and table successfully

I tried the following command and receiving the following command
terminal output:

CREATE TABLE test();
CREATE TABLE
...=# COPY activity FROM '/path/to/test.csv';
ERROR: extra data after last expected column
CONTEXT: COPY activity, line 1: "a,b"

The csv file is:

a,b
1,2

The error is due to the mistake of creating a blank table. It is
necessary to create a table with the columns configured to resemble
the columns in the csv file.

Columns can be configured manually using the 'create table' command
instructions, or use 'extract load transform' (ELT) software such as
pgloader, or kettle, or others.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedDec 29, '09 at 11:06a
activeDec 29, '09 at 11:06a
posts1
users1
websitepostgresql.org
irc#postgresql

1 user in discussion

E-letter: 1 post

People

Translate

site design / logo © 2022 Grokbase