1

If I try to import an sql script with a space in path, the file is not found.

mypsqluser=> \i /home/markus/Documents/Projekte/My App/Installation/server_sql_script.sql
/home/markus/Documents/Projekte/My: No such file or directory

I tried to escape it, with backslash, double backslash or quotes, but it doesn't work either, see:

mypsqluser=> \i /home/markus/Documents/Projekte/My\ App/Installation/server_sql_script.sql
/home/markus/Documents/Projekte/My: No such file or directory

mypsqluser=> \i "/home/markus/Documents/Projekte/My App/Installation/server_sql_script.sql"
"/home/markus/Documents/Projekte/My App/Installation/server_sql_script.sql": No such file or directory

It only works if there are no spaces in path. But how is it to do with spaces?

Bevor
  • 113
  • 1
  • 11

1 Answers1

2

Single quotes will do it; escaping the space then is optional: \i '/home/markus/Documents/Projekte/My\ App/Installation/server_sql_script.sql'

Craig Miskell
  • 4,086
  • 1
  • 15
  • 16