psql export return No such file or directory when the file exist psql export return No such file or directory when the file exist unix unix

psql export return No such file or directory when the file exist


Change that copy to \copy (https://www.postgresql.org/docs/current/static/app-psql.html#APP-PSQL-META-COMMANDS-COPY). Slightly different command that lets you copy to/from a file to your server.

The reason for the difference here is because you are connecting to a remote server (I assume), but importing a local file.


Another options is to pass your file in and have psql read from stdin like

 -c "copy externals (id,logo_path,favicon_path,cover_path,header,description,sign_enable,sign_text,footer_logo_enable,footer_logo_path,footer_text,created_at,updated_at) from STDIN with delimiter as ','" < /Applications/MAMP/htdocs/code/benu/ssc-portal/public/csv/externals.csv