admin管理员组

文章数量:1122832

I'm trying to copy a csv file in a table using PSQL tool but i receive the error: no such file or directory. This is the command: \copy company_dim FROM 'C:\Users\Username\Desktop\Data Studio\company_dim.csv/company_dim.csv' WITH (FORMAT csv, HEADER true, DELIMITER ',', ENCODING 'UTF8') I already saw other similar questions around, but no proposed solution seems to work. (i specify, the error is just "no such file or directory" not "could not connect to server...") To have more information: i'm following Luke Barousse's Youtube course on SQL. What i did should solve a permission problem from VScode, but it results in this other issue. I literally followed the problem solution proposed, which is:

Database Load Issues (follow if receiving permission denied when running SQL code below)

NOTE: If you are having issues with permissions. And you get error:

'could not open file "[your file path]\job_postings_fact.csv" for reading: Permission denied.'

  1. Open pgAdmin
  2. In Object Explorer (left-hand pane), navigate to sql_course database
  3. Right-click sql_course and select PSQL Tool
    • This opens a terminal window to write the following code
  4. Get the absolute file path of your csv files
    1. Find path by right-clicking a CSV file in VS Code and selecting �Copy Path�
  5. Paste the following into PSQL Tool, (with the CORRECT file path)

I changed the position of the csv folder; I changed the permissions of the files; I tried to change the console code page; i set the windows path for postgreSQL. I tried the command "copy" instead of "\copy". Also tried changing \ with /.

本文标签: postgresqlcopy PSQL give the error no such file or directoryStack Overflow