pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: Graham Leggett <minfrin@sharp.fm>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Could not create a tablespace - permission denied
Date: Sat, 19 Apr 2008 09:14:13 -0700
Message-ID: <480A1A55.6090800@commandprompt.com> (raw)
In-Reply-To: <480A190B.80408@sharp.fm>
References: <4809EC7B.6060902@sharp.fm>
	<9189.1208619241@sss.pgh.pa.us>
	<480A12F5.5060609@sharp.fm>
	<9478.1208620229@sss.pgh.pa.us>
	<480A190B.80408@sharp.fm>

Graham Leggett wrote:

> After the postgres user was granted permission to access the tablespace 
> directory, and after it was verified that the postgres user was able to 
> access the tablespace directory, postgresql refused to allow the 
> tablespace to be created until the postgresql server was restarted.

I am pretty sure you are missing something. I can not reproduce your issue:

jd@scratch:~$ mkdir /tmp/foo
jd@scratch:~$ psql -U postgres
postgres=# \h create tablespace
Command:     CREATE TABLESPACE
Description: define a new tablespace
Syntax:
CREATE TABLESPACE tablespacename [ OWNER username ] LOCATION 'directory'

postgres=# create tablespace foobar location '/tmp/foo';
ERROR:  could not set permissions on directory "/tmp/foo": Operation not 
permitted
postgres=#
[1]+  Stopped                 psql -U postgres
jd@scratch:~$ sudo su -
[sudo] password for jd:
root@scratch:~# chown postgres:postgres /tmp/foo
root@scratch:~# exit
logout
jd@scratch:~$ fg
psql -U postgres

postgres=# create tablespace foobar location '/tmp/foo';
CREATE TABLESPACE
postgres=#

But I am glad your problem is resolved.

Joshua D. Drake



view thread (10+ messages)  latest in thread

Message-ID: <480A1A55.6090800@commandprompt.com>
Permalink:  ../480A1A55.6090800@commandprompt.com/
Also on:    postgresql.org/message-id/480A1A55.6090800@commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jd@commandprompt.com, minfrin@sharp.fm, tgl@sss.pgh.pa.us
  Subject: Re: Could not create a tablespace - permission denied
  In-Reply-To: <480A1A55.6090800@commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox