There is a large script with a million entries, script123.sql. It was uploaded to the Ubuntu 14.04 server on which postgresql 9.4 is running, from the windows machine, via winscp. When you start psql from under the windows of the machine (which is part of PGAdmin III), when you try to load the script via the \i script123.sql error is displayed that there is no file: script123.sql No such file or directory , both when specifying both relative paths and direct:

 \i /home/user/script123.sql /home/user/script123.sql No such file or directory \i ../script123.sql /home/user/script123.sql No such file or directory 

Where do I need to copy this script so that it can be run from psql (windows)? On Windows, just copy the script to: C: \ Program Files \ PostgreSQL \ 9.4 \ data. I tried to copy "by analogy" in /var/lib/postgresql/9.4/main and /etc/postgresql/9.4/main/ - does not help ...

    1 answer 1

    When running psql from under windows of a machine

    \ i is the psql client command, the file can only be read from the local machine, from the one on which psql is running, and the postgresql server can be anywhere.

    Therefore, if you want to run psql on the client, then the file should be located somewhere on the client.