Re: BUG #2904: COPY FROM -> permisson denied
От | Tom Lane |
---|---|
Тема | Re: BUG #2904: COPY FROM -> permisson denied |
Дата | |
Msg-id | 17049.1169228101@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | BUG #2904: COPY FROM -> permisson denied ("Izsak Rudolf" <rudolf_izsak@yahoo.de>) |
Список | pgsql-bugs |
"Izsak Rudolf" <rudolf_izsak@yahoo.de> writes: > Operating system: Fedora Core 6 > Description: COPY FROM -> permisson denied > I wanted to COPY the content of the sample data file /home/csakmost.txt to > my data table t_crdc1 using the following command: > exp03038=# COPY t_crdc1 FROM '/home/csakmost.txt' WITH DELIMITER ' ' NULL > 'NULL'; > But I have got the error message: > ERROR: could not open file "/home/csakmost.txt" for reading: Hozzáférés > megtagadva > I have set the permissons of the file "/home/csakmost.txt" also, so that it > can be read by any users (both of the file and the directory). Also if I try > to read the file as user postgres, it works: You're getting burnt by SELinux restrictions: network-accessible daemons such as postgresql are normally constrained to not be able to read or write portions of the filesystem outside what they're "supposed" to be touching, which for postgres is just /var/lib/pgsql/. This is considered a good thing since it limits the damages if someone is able to subvert one of those server processes. The quick answer might be to temporarily turn off SELinux (see "setenforce") while you load the file. A more security-aware approach would be to modify the SELinux policy to let postgres read some chosen directory for dropping files-to-load into. regards, tom lane
В списке pgsql-bugs по дате отправления: