Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 74B5E2E002C for ; Sat, 19 Apr 2008 12:34:05 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67682-04 for ; Sat, 19 Apr 2008 12:34:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 380C02E009A for ; Sat, 19 Apr 2008 12:34:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3JFY1ow009190; Sat, 19 Apr 2008 11:34:02 -0400 (EDT) To: Graham Leggett cc: pgsql-admin@postgresql.org Subject: Re: Could not create a tablespace - permission denied In-reply-to: <4809EC7B.6060902@sharp.fm> References: <4809EC7B.6060902@sharp.fm> Comments: In-reply-to Graham Leggett message dated "Sat, 19 Apr 2008 14:58:35 +0200" Date: Sat, 19 Apr 2008 11:34:01 -0400 Message-ID: <9189.1208619241@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/198 X-Sequence-Number: 28962 Graham Leggett writes: > While attempting to create a tablespace as the postgres user under RHEL5 > with *no* SELinux enabled, I get the following error: > postgres=# CREATE TABLESPACE fma LOCATION '/home/chandler/fma/db/pgsql'; > ERROR: could not set permissions on directory > "/home/chandler/fma/db/pgsql": Permission denied > The user postgres is able to access the directory, and the user postgres > is able to set permissions on the directory to 0700: > -bash-3.1$ chmod 700 /home/chandler/fma/db/pgsql If you can do that from a shell running as postgres, then I think selinux is not so disabled as you think. Ordinary file permissions are applied uniformly to all processes running as a given userid, but selinux is different. regards, tom lane