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 error creating directory permission denied User groups Project lists Inactive lists IRC Local User
Error Creating Directory Permission Denied Raspberry
Groups Featured Users International Sites Propaganda Resources Weekly News Re: Could not create change directory permission denied a tablespace - permission denied From: "Joshua D(dot) Drake"
Could Not Set Permissions On Directory Postgres Windows
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 site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads postgresql check if tablespace exists with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack error could not set permissions on directory operation not permitted 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
Postgres List Tablespaces
up PostgreSQL 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' https://www.postgresql.org/message-id/480A1A55.6090800@commandprompt.com 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 /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 http://stackoverflow.com/questions/20322397/postgresql-create-tablespace-no-permission 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 Answer 1 active oldest votes up vote 5 down vote accepted At a wild guess I'd say you're on Mac OS X and your PostgreSQL is running as the user postgres_ (note the underscore), as is used by some PostgreSQL packages. ps -ef | grep postgres or ps aux|grep postgres should show you what user the server is running as. Make sure the directory is owned by that user. Update based on extra info in comments: You're on CentOS, not Mac OS X. Your PostgreSQL is running as user postgres, which is the same owner as the directory. It thus seems likely that you are having issues with SELinux. If, for testing purposes only, you run: setenforce
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers https://ubuntuforums.org/showthread.php?t=1824149 Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful https://bugzilla.redhat.com/show_bug.cgi?id=443223 Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Permissions error with PostgreSQL psql process Having an Issue With Posting ? Do you want to permission denied help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 2 of 2 Thread: Permissions error with PostgreSQL psql process Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode August 13th, 2011 #1 gargoyle60 View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join directory permission denied Date Jun 2009 Location Kent, England Beans 32 DistroUbuntu 11.04 Natty Narwhal Permissions error with PostgreSQL psql process Need help please! I have installed PostgreSQL 9.0 in Ubuntu 11.04. The following is a bit long-winded and cross-relates to PostgreSQL, but I'm sure others are using it on Ubuntu so might offer help. I ran the PostgreSQL installation thus: Code: sudo su ./postgresql-9.0.4-1-linux.bin accepting all the installer defaults except specifying the Data Directory as "/home/gary/PostgreSQL/9.0/data/gjd_data/gjd_sentinel_data" (NB. quotes shown here for emphasis only, not entered to the installer) Beforehand I manually created a data directory structure to isolate my personal data files (as myself, not using sudo): Code: mkdir /home/gary/PostgreSQL/ mkdir /home/gary/PostgreSQL/9.0 mkdir /home/gary/PostgreSQL/9.0/data/ mkdir /home/gary/PostgreSQL/9.0/data/gjd_data mkdir /home/gary/PostgreSQL/9.0/data/gjd_data/gjd_sentinel_data I have a personal project database script file (copied from my Windows installation) that I know works perfectly under Windows. It has been modified for the correct paths/locations, etc. for Linux. When run this should create my entire project database, including loading sample data. This script file is called "Z_Build_DB_Linux.sql" I am trying to run psql in batch mode as follows (long command, line wrapped here): Code: /opt/PostgreSQL/9.0/bin/psql --dbname postgres --host localhost --port 5432 --username postgres --file /home/gary/PostgreSQL/9.0/data/gjd_data/Z_Build_DB_Linux.sql
Login: [x] Format For Printing -XML -Clone This Bug -Last Comment First Last Prev Next This bug is 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 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: 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 the admin go