Re: Permission problem with create tablespace - Mailing list pgsql-general

From Tom Lane
Subject Re: Permission problem with create tablespace
Date
Msg-id 8626.1161049018@sss.pgh.pa.us
Whole thread Raw
In response to Permission problem with create tablespace  ("Andras Simon" <szajmi@gmail.com>)
Responses Re: Permission problem with create tablespace
List pgsql-general
"Andras Simon" <szajmi@gmail.com> writes:
> I'm trying to create a new tablespace in a directory that postgres
> owns, but PG says it cannot  set permissions on this directory.
> ...
> This is on Fedora Core 5 (x86), psql 8.1.4.

Do you have selinux enabled?  The default selinux policy disallows the
postgres daemon from writing anywhere outside the standard
/var/lib/pgsql/data directory tree.  Check for "avc denied" messages in
the kernel log to verify this.

To use a nondefault tablespace, you'd want to tweak the policy to allow
postgres to write that directory tree too.  I'm afraid I know too little
about selinux to explain exactly what to do though ... need to learn
that someday ...

A quick and dirty solution is to put selinux into non-enforcing mode,
but if this machine is exposed to the internet at all, that's probably
not a good answer.

            regards, tom lane

pgsql-general by date:

Previous
From: "Leonel Nunez"
Date:
Subject: Re: Permission problem with create tablespace
Next
From: "Andras Simon"
Date:
Subject: Re: Permission problem with create tablespace