1

We've just set up a postgres 9.3 server on a Windows 7 machine. If we try to copy data into a database from C:\dbfeeds\csv.csv we get the following error:

ERROR: could not open file "C:\dbfeeds\csv.csv" for reading: Permission denied
SQL state: 42501

I've been running 9.1 on a separate machine and the solution there was to give postgres (the default database user) read/write permissions on that directory. However this user does not show up in the users on the machine that's running 9.3.

What do I need to do to enable the directory for reading by the database?

Craig Ringer
  • 11,083
  • 9
  • 40
  • 61
JamesF
  • 195
  • 1
  • 2
  • 5

1 Answers1

1

9.3 (and 9.2, when the change was made) runs as NETWORKSERVICE by default. So that user must have read rights on the file.

However, in general I recommend using psql's \copy or the PgAdmin-III import tool, rather than having the server read the file directly.

Craig Ringer
  • 11,083
  • 9
  • 40
  • 61