Обсуждение: Creation of tablespaces
Hello, I work with Ubuntu 9.10 (upgraded from 8.04 LTS yesterday) and PostgreSQL 8.3. I can't create tablespaces. Pgsql seems to try changing access rights of the directory and fails to do it (permission denied),despite the directory is owned by the postgres user Under the Ubuntu 8.04 LTS distribution I had no problem with table spaces... Any idea ? bdurand@bdurand-desktop:/var/lib/postgresql/8.3$ sudo psql template1 -U postgres Mot de passe pour l'utilisateur postgres : Bienvenue dans psql 8.3.8, l'interface interactive de PostgreSQL. Saisissez: \copyright pour les termes de distribution \h pour l'aide-mémoire des commandes SQL \? pour l'aide-mémoire des commandes psql \g ou point-virgule en fin d'instruction pour exécuter la requête \q pour quitter template1=# create tablespace lacie owner bdurand location '/media/DD_LaCie/postgres/8.3'; ERREUR: n'a pas pu configurer les droits du répertoire « /media/DD_LaCie/postgres/8.3 » : Permission non accordée
=?iso-8859-1?Q?DURAND_Beno=EEt?= <b.durand@AFSSA.FR> writes: > I work with Ubuntu 9.10 (upgraded from 8.04 LTS yesterday) and PostgreSQL 8.3. > I can't create tablespaces. Pgsql seems to try changing access rights of the directory and fails to do it (permission denied),despite the directory is owned by the postgres user Are you sure that postgres has r+x rights on all the directories above that one? If this were a Red Hat distro I would also wonder about selinux permissions, but I don't know whether Ubuntu has selinux or enables it by default. regards, tom lane
The directory is on another (external) disk, mounted under /media. Postgres has not r+x rights on that directory (or on /)which belong to root. regards, Benoit Durand ________________________________________ De : Tom Lane [tgl@sss.pgh.pa.us] Date d'envoi : vendredi 15 janvier 2010 16:51 À : DURAND Benoît Cc : pgsql-general@postgresql.org Objet : Re: [GENERAL] Creation of tablespaces =?iso-8859-1?Q?DURAND_Beno=EEt?= <b.durand@AFSSA.FR> writes: > I work with Ubuntu 9.10 (upgraded from 8.04 LTS yesterday) and PostgreSQL 8.3. > I can't create tablespaces. Pgsql seems to try changing access rights of the directory and fails to do it (permission denied),despite the directory is owned by the postgres user Are you sure that postgres has r+x rights on all the directories above that one? If this were a Red Hat distro I would also wonder about selinux permissions, but I don't know whether Ubuntu has selinux or enables it by default. regards, tom lane
=?iso-8859-1?Q?DURAND_Beno=EEt?= <b.durand@AFSSA.FR> writes: > The directory is on another (external) disk, mounted under /media. Postgres has not r+x rights on that directory (or on/) which belong to root. That would be your problem then ... (It might not actually need r, but it definitely must have x, in order to follow that path at all.) regards, tom lane
Ubuntu never shipped with selinux, it is available by installing the "selinux" meta-package. Ubuntu does ship with AppArmor and loaded by default in Hardy 8.04 and beyond but I don't believe there are any PotgreSQL profiles. Aaron Thul http://www.chasingnuts.com On Fri, Jan 15, 2010 at 10:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > =?iso-8859-1?Q?DURAND_Beno=EEt?= <b.durand@AFSSA.FR> writes: >> I work with Ubuntu 9.10 (upgraded from 8.04 LTS yesterday) and PostgreSQL 8.3. >> I can't create tablespaces. Pgsql seems to try changing access rights of the directory and fails to do it (permissiondenied), despite the directory is owned by the postgres user > > Are you sure that postgres has r+x rights on all the directories above > that one? > > If this were a Red Hat distro I would also wonder about selinux > permissions, but I don't know whether Ubuntu has selinux or enables > it by default. > > regards, tom lane > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general >