Postgresql Error Could Not Set Permissions On Directory Permission Denied
Contents |
pgsql-announce pgsql-bugs pgsql-docs pgsql-general pgsql-interfaces pgsql-jobs pgsql-novice pgsql-performance pgsql-php pgsql-sql pgsql-students Developer lists Regional lists Associations User groups
Postgres Create Tablespace Permission Denied Windows
Project lists Inactive lists IRC Local User Groups Featured Users could not set permissions on directory postgres windows International Sites Propaganda Resources Weekly News Re: Could not create a tablespace - permission
Error: Could Not Set Permissions On Directory : Operation Not Permitted
denied From: "Joshua D(dot) Drake"
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 this
Postgres List Tablespaces
site About Us Learn more about Stack Overflow the company Business Learn create table postgres more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PostgreSQL https://www.postgresql.org/message-id/480A1A55.6090800@commandprompt.com create tablespace no permission up vote 1 down vote favorite I've got a problem when I create tablespace for PostgreSQL. The following are the steps: mkdir /postgres chown postgres.postgres /postgres su - postgres psql create tablespace p1 location '/postgres' In this step I got a error: could not set permissions on directory "/postgres": Permission denied The directory ownership is correct: [root@dev ~]# ls -la http://stackoverflow.com/questions/20322397/postgresql-create-tablespace-no-permission /postgres 总用量 8 drwxr-xr-x. 2 postgres postgres 4096 12月 2 13:17 . dr-xr-xr-x. 28 root root 4096 12月 3 06:57 .. the user is postgres [root@dev contrib]# ps -ef|grep postgres postgres 1971 1 0 08:21 ? 00:00:01 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data I'm running on CentOS. fix: setenforce 0 database postgresql share|improve this question edited Dec 3 '13 at 6:51 asked Dec 2 '13 at 6:50 9ban 816 Could you paste the output of ls -la /postgres? –Milen A. Radev Dec 2 '13 at 9:36 thank you for help [root@dev data]# ls -la /postgres 总用量 8 drwxr-xr-x. 2 postgres postgres 4096 12月 2 13:17 . dr-xr-xr-x. 28 root root 4096 12月 2 13:17 .. –9ban Dec 2 '13 at 11:17 Please append the listing to the question - right now it's illegible. –Milen A. Radev Dec 2 '13 at 13:37 ls -dZ /postgresql, ls -dZ /var/lib/pgsql/9.3 (or whatever your Pg version is) and ps Z -u postgres please. Also, always include your PostgreSQL version and OS in all questions. –Craig Ringer Dec 3 '13 at 2:34 add a comment| 1 Answ
Login: [x] Format For Printing -XML -Clone This Bug -Last Comment First Last Prev Next This bug is https://bugzilla.redhat.com/show_bug.cgi?id=443223 not in your last search results. Bug443223 - Tablespace creation failure: could not set permissions on directory Summary: Tablespace creation failure: could not set permissions on directory Status: CLOSED NOTABUG Aliases: None Product: Red Hat Enterprise Linux 5 Classification: Red Hat Component: postgresql (Show other bugs) Sub Component: --- Version: 5.3 Hardware: All Linux Priority low Severity low could not TargetMilestone: rc TargetRelease: --- Assigned To: Tom Lane QA Contact: Docs Contact: URL: Whiteboard: Keywords: Depends On: Blocks: Show dependency tree /graph Reported: 2008-04-19 08:54 EDT by Graham Leggett Modified: 2013-07-02 23:17 EDT (History) CC List: 1 user (show) hhorak See Also: Fixed In Version: Doc Type: Bug Fix Doc Text: Story Points: --- Clone Of: Environment: could not set Last Closed: 2008-04-19 12:30:04 EDT Type: --- Regression: --- Mount Type: --- Documentation: --- CRM: Verified Versions: Category: --- oVirt Team: --- RHEL 7.3 requirements from Atomic Host: Cloudforms Team: --- Attachments (Terms of Use) Add an attachment (proposed patch, testcase, etc.) Groups: None (edit) Description Graham Leggett 2008-04-19 08:54:40 EDT When an attempt is made to create a tablespace, where the tablespace directory exists, the ownership is correct, and the permissions have been correctly set to 0700, and SELinux is *disabled*, the following error occurs: postgres=# CREATE TABLESPACE fma LOCATION '/home/chandler/fma/db/pgsql'; ERROR: could not set permissions on directory "/home/chandler/fma/db/pgsql": Permission denied The problem comes down to the following piece of code within postgres, which incorrectly tries to set the permissions on the tablespace directory to 0700. What the code is trying to do is to ensure the permissions are set to 0700 by setting the permissions to 0700. What the code should be doing is testing that the permissions are 0700, and throwing an error if this is not the case. This saves