Skip site navigation (1) Skip section navigation (2)

Re: permissions failure to copy csv data

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: e-letter <inpost(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: permissions failure to copy csv data
Date: 2010-10-09 14:47:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
e-letter <inpost(at)gmail(dot)com> writes:
> The following command was entered from normal user account where csv files are:

> COPY newdatabasenametable FROM '/path/to/file.csv' WITH CSV;
> ERROR:  could not open file "/path/to/file.csv" for reading: Permission denied

The postgres account either doesn't have permission to read that file,
or doesn't have permission to search one of the directories in the path.

> su root
> su postgres
> psql newdatabasename
> could not change directory to "/path/to

This would work better with "su -l postgres", so that you don't end
up with a situation where psql is being started in a directory it
has no permissions for.

			regards, tom lane

In response to


pgsql-novice by date

Next:From: Mark KellyDate: 2010-10-09 14:51:59
Subject: Re: MySQL --> PostgreSQL with PHP
Previous:From: Helgi Örn HelgasonDate: 2010-10-09 09:09:04
Subject: Re: MySQL --> PostgreSQL with PHP

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group