[Django]-Copy in Postgresql: Absolute Path Interpreted as Relative Path

7πŸ‘

βœ…

If you want to store data / get data from your local machine and communicate with a Postgres server on a different, remote machine, you cannot simply use COPY.

Try the meta-command \copy in psql. It’s a wrapper for the SQL COPY command and uses local files.

Your filename should work as is on a Windows machine, but Postgres interprets it as a local filename on the server, which is probably a Unix derivate. And there the filename would have to start with β€˜/’.

Leave a comment