I'm new to PostgreSQL and I wanted to use or run a specific file on the SQL-Shell on windows but I`m getting some errors of what I think is not making sense from my knowledge.

I ran the following...

\i 'C: \Users\Username\Documents\person.sql' : No such file or directory

I don`t know why this is not functioning with the quotes and by default this file exists, which I downloaded from a website!

Through my experimentation, I ran the following again without quotes with a different error

\i C: \Users\Username\Documents\person.sql : Permission denied

I don't know why it says at first it doesn't exist but later getting no permission over the file. My question is what is the problem with the following executions and is something wrong with my running?

I looked at this site and saw common problems but it couldn't help me further!


  • Using / instead of \ seemed to be the solution in this thread: dba.stackexchange.com/questions/29767/…
    – Lennart
    Aug 2 '20 at 15:16
  • It`s not working with / instead
    – Gregory
    Aug 2 '20 at 15:19
  • \i 'C: /Users/Username/Documents/person.sql' C: /Users/Username/Documents/person.sql: No such file or directory
    – Gregory
    Aug 2 '20 at 15:23
  • If you remove the space in 'C: /Users...'?
    – Lennart
    Aug 2 '20 at 15:24
  • \i 'C:/Users/Username/Documents/person.sql' C:/Users/Username/Documents/person.sql: No such file or directory. It doesn't work without space.
    – Gregory
    Aug 2 '20 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.