0

I am using PythonAnywhere to practice loading csv file into postgre table.

I download file to the local C:\Users\YXFU\Desktop from https://www.pg4e.com/tools/sql/library.csv?PHPSESSID=3b1ad20ab2a59efb32411ec93d1906ca%22., and then I wrote query-

\copy track_raw(title, album, album_id, count, rating, len) FROM 'library.csv' WITH DELIMITER ',' CSV.

the result always return to be"library.csv: No such file or directory"

I just want to know how can I load an outside file to PythonAnywhere, and then I can work on it. thanks

isherwood
  • 58,414
  • 16
  • 114
  • 157
F. Y.
  • 1
  • 1
  • Best guess is you are not running `psql` in the `C:\Users\YXFU\Desktop` directory. In that case you need to supply the complete path to the file. – Adrian Klaver Sep 12 '22 at 18:15
  • 1
    Since the postgres machine is remote from where your console is running, you should use one of the options here: https://stackoverflow.com/questions/33353997/how-to-insert-csv-data-into-postgresql-database-remote-database – Glenn Sep 14 '22 at 09:52

0 Answers0