pgadmin4 import csv issue

From: Huston Bokinsky <huston(dot)bokinsky(at)gamut(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: pgadmin4 import csv issue
Date: 2016-12-21 18:59:38
Message-ID: CAPMzu8x=2W=hqne1oZS8ZJMjbA7PR+ts4YSUZmetzOdkzzuV_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi all,

Using pgadmin v. 4.1.1 on a Mac laptop (Sierra), connected to a remote
postgres db v. 9.5.5. I am trying to import csv data into the db
using the import/export tool. I am importing data from a file on my
laptop, so browse to the csv file in the 'Filename' bar. The import
fails with a message (with hostnames and usernames anonymized):

<remote_host>:/usr/bin/psql --host "<remote_host>" --port "5432"
--username "<user>" --dbname "testdb" --command "\copy
public."<target_table>" (id, col1, col2) FROM
'/path/to/file/on/local/machine.csv' DELIMITER ',' CSV HEADER QUOTE
'"' ESCAPE '''';"

which is failing with a message "No such file or directory".

So, two questions:

1) How can I import data from a csv file on a local machine to a
remote database using pgadmin4?

2) As it is written above, won't the import command be looking for an
id column in the csv values? I declared the id field in my schema as
a serial datatype, so how can I use the pgadmin4 import tool to import
csv values with only two columns?

Thanks for any assistance.

Browse pgadmin-support by date

  From Date Subject
Next Message Shira Bezalel 2016-12-23 22:31:19 PgAdmin4 crashing on Windows 10
Previous Message Jack Royal-Gordon 2016-12-21 18:42:17 Suggestion regarding Auto-Save