Error Could Not Set Permissions On Directory Operation Not Permitted
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of postgres create tablespace permission denied windows this site About Us Learn more about Stack Overflow the company Business Learn
Could Not Set Permissions On Directory Postgres Windows
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question could not set permissions on directory permission denied x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up postgresql check if tablespace exists Creating a tablespace in postgresql up vote 6 down vote favorite 3 I'm trying to create a tablespace in postgres, but I'm getting ownership problems. The command I'm using is: CREATE TABLESPACE magdat OWNER maggie LOCATION '/home/john/BSTablespace' I get the error: ERROR: could not set permissions on directory "/home/john/BSTablespace": Operation not permitted The folder belongs to postgres:postgres, I've tried changing it to maggie, but
Postgres List Tablespaces
if I go : chown maggie:postgres /home/john/BSTablespace I get: chown: invalid user: `maggie:postgres' How come the user does not exist? If I list the users inside of postgres it does come up. Any ideas what I could be doing wrong? postgresql tablespace chown share|improve this question asked Mar 6 '11 at 1:45 The_Denominater 4004518 add a comment| 1 Answer 1 active oldest votes up vote 13 down vote accepted I would hazard a guess that the problem lies in the permissions of the parent directory "/home/john". Your home directory is probably setup so that only your user has access (i.e chmod 700) to it (it's a good thing for your home directory to be chmod 700, don't change it). Doing something like: mkdir /BSTablespace chown postgres:postgres /BSTablespace and then CREATE TABLESPACE magdat OWNER maggie LOCATION '/BSTablespace'; should work fine. Regarding the user maggie: database users are not the same as OS users. That isn't to say that you couldn't have a user in both places named maggie-- but you would need to create the user in both the database and the OS for that to happen. share|improve this
messages Andras Simon Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ [GENERAL] Permission problem with create tablespace I'm trying to create a new tablespace in a directory that postgres owns, but postgres tablespace permissions PG says it cannot set permissions on this directory. [root@localhost ~]# su - postgres -bash-3.1$ postgresql create tablespace mkdir /opt/home/pgdata/mspace/ -bash-3.1$ psql Welcome to psql 8.1.4, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for
Create Table Postgres
help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit postgres=# CREATE TABLESPACE mspace LOCATION '/opt/home/pgdata/mspace'; ERROR: http://stackoverflow.com/questions/5208094/creating-a-tablespace-in-postgresql could not set permissions on directory "/opt/home/pgdata/mspace": Permission denied postgres=# \q -bash-3.1$ chmod 700 /opt/home/pgdata/mspace/ -bash-3.1$ whoami postgres -bash-3.1$ This is on Fedora Core 5 (x86), psql 8.1.4. Andras ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [hidden email] so that your message can get through to the mailing list cleanly Douglas McNaught Reply | Threaded Open this post in http://postgresql.nabble.com/GENERAL-Permission-problem-with-create-tablespace-td1868906.html threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: [GENERAL] Permission problem with create tablespace "Andras Simon" <[hidden email]> 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. SELinux, most likely. -Doug ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ Leonel Nunez-2 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: [GENERAL] Permission problem with create tablespace In reply to this post by Andras Simon > I'm trying to create a new tablespace in a directory that postgres > owns, but PG says it cannot set permissions on this directory. > > [root@localhost ~]# su - postgres > -bash-3.1$ mkdir /opt/home/pgdata/mspace/ > -bash-3.1$ psql > Welcome to psql 8.1.4, the PostgreSQL interactive terminal. > > Type: \copyright for distribution terms > \h for help with SQL commands > \? for help with psql commands > \g or terminate with semicolon to execute query > \q to quit > > postgres=# CREATE TABLESPACE mspace LOCATION '/opt/home/pgdata/msp
07:21 PMhi all, i even loginned as root and when trying to change it says:Sorry, could not change the permissions of "resolv.conf": Error setting permissions: Operation not permitted 1.owner of the file https://ubuntuforums.org/archive/index.php/t-2010366.html is root 2.i logined as root it still rejects to change the permission of the file. https://bbs.archlinux.org/viewtopic.php?id=151593 any helps please? PaqmanJune 25th, 2012, 07:25 PMOn Ubuntu it's normally neither possible nor necessary to log in as root. When you say you logged in as root, what exactly did you do? Normally all you need to do to take on root's powers is: Preface a terminal command with sudo OR Launch a graphical app with the preface gksudo (or could not kdesu for KDE) You can do these from your normal account if it's an administrator account (which the first account on the machine will be). ihsankocakJune 25th, 2012, 07:28 PMOn Ubuntu it's normally neither possible nor necessary to log in as root. When you say you logged in as root, what exactly did you do? Normally all you need to do to take on root's powers is: Preface a terminal command with sudo OR Launch a could not set graphical app with the preface gksudo (or kdesu for KDE) You can do these from your normal account if it's an administrator account (which the first account on the machine will be). i unlocked the root user by: sudo passwd -u rootthen i logged in as root WinuxUserJune 25th, 2012, 07:28 PMhi all, i even loginned as root and when trying to change it says:Sorry, could not change the permissions of "resolv.conf": Error setting permissions: Operation not permitted 1.owner of the file is root 2.i logined as root it still rejects to change the permission of the file. any helps please? Welcome with your first post... at your terminal, in order to edit any file, type sudo before the command... for example, if your file is abc.txt located at /usr/bin, in terminal type sudo gedit /usr/bin/abc.txt ihsankocakJune 25th, 2012, 07:34 PMWelcome with your first post... at your terminal, in order to edit any file, type sudo before the command... for example, if your file is abc.txt located at /usr/bin, in terminal type sudo gedit /usr/bin/abc.txt thank you.i tried sudo gedit /etc/resolv.conf, i could edit the file but it did not allow to save it i t said:You do not have the permissions necessary to save the file. Please check that you typed the location correctly and try again. steeldriverJune 25th, 2012, 07:38 PMHi what version of Ubuntu a
#1 2012-10-28 13:15:05 robrene Member Registered: 2009-04-16 Posts: 168 [SOLVED] Can't get PostgreSQL to start after following Wiki instruc... I'm trying to start the postgresql service on my systemd installation. I've followed the instructions on the wiki. First I installed the package postgresql, then I uncommented the PGROOT line in the configuration file.When I try to run systemctl start postgresql, I get the following:# systemctl start postgresql Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -n' for details.# systemctl status postgresql postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled) Active: failed (Result: exit-code) since Sun, 2012-10-28 14:08:48 CET; 34s ago Process: 12687 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=1/FAILURE) CGroup: name=systemd:/system/postgresql.service Oct 28 14:08:48 nemesis systemd[1]: Starting PostgreSQL database server... Oct 28 14:08:48 nemesis postgres[12687]: "/var/lib/postgres/data" is missing or empty. Use a command like Oct 28 14:08:48 nemesis postgres[12687]: su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'" Oct 28 14:08:48 nemesis postgres[12687]: with relevant options, to initialize the database cluster. Oct 28 14:08:48 nemesis systemd[1]: Failed to start PostgreSQL database server. Oct 28 14:08:48 nemesis systemd[1]: Unit postgresql.service entered failed stateI tried doing what it suggested to me:# su - postgres -c "initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'" The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". cr