admin 管理员组

文章数量: 1086019

I am trying to import CSV file in PostgreSQL, but every time I run the query it gives me could not open file "‪D:\employee_data.csv" for reading: No such file or directory. What possibly could be the reason for such error?

I am using pgadmin4 tool in Windows to connect the database which is also in a Windows environment.

This is the query:

COPY
employee(employee_id, first_name, last_name, department, salary, joining_date, age)
FROM'‪D:\employee_data.csv'
DELIMITER','
CSV HEADER;

While running this query I get this error:

ERROR:  could not open file "‪D:\employee_data.csv" for reading: No such file or directory
HINT:  COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy. 

SQL state: 58P01

本文标签: databaseHow to Import correctly CSV file using pgAdmin4 in postgreSQLStack Overflow