"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