Home > Could Not > Could Not Set Permissions On Directory Postgresql

Could Not Set Permissions On Directory Postgresql

Contents

Not the answer you're looking for? there is no "cacheing of credentials" in there that I know about. for help with psql commands\g or terminate with semicolon to execute query\q to quitpostgres=# CREATE TABLESPACE mspace LOCATION '/opt/home/pgdata/mspace';ERROR: could not set permissions on directory"/opt/home/pgdata/mspace": Permission deniedpostgres=# \q-bash-3.1$ chmod 700 /opt/home/pgdata/mspace/-bash-3.1$ The machine does not have SELinux installed, never mind enabled. Source

for help with psql commands\g or terminate with semicolon to execute query\q to quitpostgres=# CREATE TABLESPACE mspace LOCATION '/opt/home/pgdata/mspace';ERROR: could not set permissions on directory"/opt/home/pgdata/mspace": Permission deniedpostgres=# \q-bash-3.1$ chmod 700 /opt/home/pgdata/mspace/-bash-3.1$ Ideally the error message should suggest that the server might need to be restarted before the permissions take effect. 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. Perhaps the best option is to just change the SELinux context of the file.

Postgres Create Tablespace Permission Denied Windows

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 there is no "cacheing of >> credentials" in there that I know about. > The server is a standard REHL5 installed copy of postgresql, running as > the postgres user (as I am pretty sure you are missing something. regards, tom lane -- Sent via pgsql-admin mailing list ([hidden email]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin Graham Leggett Reply | Threaded Open this post in threaded view ♦ ♦

Check for "avc denied" messages in the kernel log to verify this. more hot questions question feed lang-sql about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation share|improve this answer edited Dec 3 '13 at 7:06 answered Dec 3 '13 at 1:31 Craig Ringer 139k20235330 i'm on centos.i've checked it.the user is postgres.follow is the result. Postgres Tablespace Permissions If this fails,00301 * it doesn't exist or has the wrong owner.00302 */00303 if (chmod(location, 0700) != 0)00304 ereport(ERROR,00305 (errcode_for_file_access(),00306 errmsg("could not set permissions on directory \"%s\": %m",00307 location)));00308so basically it

Dual boot with Windows XP Home Adv Reply August 18th, 2011 #2 gargoyle60 View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join Date Jun 2009 Location Kent, Regards, Graham -- smime.p7s (4K) Download Attachment Tom Lane-2 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: Could not Top nosaku Posts: 1 Joined: 2008/04/05 08:27:18 Re: postgres 8.3 create tablespace problem Quote Postby nosaku » 2008/04/05 08:30:57 I am having the same problem on RHEL 5. Ordinary file permissions are > applied uniformly to all processes running as a given userid, but > selinux is different.

there it is. How To Create A Tablespace In Postgresql Did Donald Trump say that "global warming was a hoax invented by the Chinese"? Regards, Graham -- I'd check that the user postgresql is running as can create files in /home/chandler/fma/db/pgsql # assuming postgres is the user su - postgres touch /home/chandler/fma/db/pgsql/foo rm /home/chandler/fma/db/pgsql/foo Hugh I'm afraid I know too littleabout selinux to explain exactly what to do though ...

Could Not Set Permissions On Directory "": Permission Denied

Drake Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: Could not create a tablespace - permission denied Graham Leggett https://bugzilla.redhat.com/show_bug.cgi?id=443223 Sincerely, Joshua D. Postgres Create Tablespace Permission Denied Windows Is it possible to see animals from space? Could Not Set Permissions On Directory Postgres Windows Or you can turn SELinux off entirely, but that's not really preferable.

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. this contact form What the code should be doing is testing that the permissions are 0700, and throwing an error if this is not the case. Andras Simon at Oct 17, 2006 at 1:04 pm ⇧ On 10/17/06, Leonel Nunez wrote:Correction to my prior maildo this as root :chcon system_u:object_r:postgresql_db_t /opt/home/pgdata/mspaceWhen you need to know what config Redhat Enterprise Linux 5 refuses to allow a user to chmod a directory, even though that user owns that directory. Error: Could Not Set Permissions On Directory Operation Not Permitted

It doesn't matter if I run this as user "gary" or "root". 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. On that basis I can't see why there is the problem. http://strobelfilms.com/could-not/could-not-set-permissions-on-directory.html This is my environment (sorry, lines may wrap again): Code: [email protected]:~$ export PGHOME=/opt/postgres/9.0 [email protected]:~$ export PGDATA=/home/gary/PostgreSQL/9.0/data/gjd_data ...snip...

The default selinux policy disallows the postgres daemon from writing anywhere outside the standard /var/lib/pgsql/data directory tree. Postgres Change Tablespace It's better to use semanage as discussed in the next page of the linked manual. Check for "avc denied" messages inthe kernel log to verify this.To use a nondefault tablespace, you'd want to tweak the policy to allowpostgres to write that directory tree too.

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

Put it in root and there was no problem. –The_Denominater Mar 7 '11 at 0:06 @gsiems update your answer, chown postgres:postgres /Directory. –Giri Nov 3 '15 at 14:27 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 How to respond to a ridiculous request from a senior colleague? Postgres Tablespace Location At it turned out, the postgresql server had cached the system user permissions, and it only started working after postgresql had been restarted and the cached credentials had been replaced.

In addition, if SELinux is enabled, this gives a further reason why the code will fail. ps -ef | grep postgres or ps aux|grep postgres should show you what user the server is running as. Code: sudo apt-add-repository ppa:pitti/postgresql sudo apt-get update sudo apt-get install postgresql-9.0 sudo apt-get install postgresql-client-9.0 sudo apt-get install postgresql-contrib-9.0 sudo apt-get install pgadmin3 Now everything working. Check This Out Drake wrote: > I am pretty sure you are missing something.

Comment 2 Graham Leggett 2008-04-19 11:32:57 EDT As it turned out, the postgresql server had cached permission credentials, so while the postgres user could see the directory without a problem, this Drake Joshua D. Home | New | Search | [?] | Reports | Requests | Help | NewAccount | Log In [x] | Forgot Password Login: [x] | Report Bugzilla Bug Legal [Date Prev][Date Sever-sort an array How do organic chemistry mechanisms become accepted?

Fascinating. Update based on extra info in comments: You're on CentOS, not Mac OS X. You can use chcon, but then the change will be lost after a file system relabel. If I list the users inside of postgres it does come up.

See the help for the setsebool command, the Fedora Security Guide, the CentOS SELinux howto, etc. Note You need to log in before you can comment on or make changes to this bug. reply | permalink Tom Lane The specified directory has to be owned by the postgres operating system user, not by anyone else. (The SQL-level notion of ownership is not relevant --- What is a real-world metaphor for irrational numbers?

there it is. vBulletin 2000 - 2016, Jelsoft Enterprises Ltd. If this 01285 * fails, it doesn't exist or has the wrong owner. 01286 */ 01287 if (chmod(location, 0700) != 0) 01288 ereport(ERROR, 01289 (errcode_for_file_access(), 01290 errmsg("could not set permissions on asked 3 years ago viewed 2765 times active 3 years ago Related 970PostgreSQL “DESCRIBE TABLE”671Show tables in PostgreSQL423Creating a copy of a database in PostgreSQL274Copying PostgreSQL database to another server513Drop all

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 Could large but sparsely populated country control its borders? regards, tom lane -- Sent via pgsql-admin mailing list ([hidden email]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin Graham Leggett Reply | Threaded Open this post in threaded view ♦ ♦ User contributions on this site are licensed under the Creative Commons Attribution Share Alike 4.0 International License.

The server is a standard REHL5 installed copy of postgresql, running as the postgres user (as is standard on RHE5). more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed I think you might possibly have a reason to file a kernel bug here, but it's not a postgres bug. Fields that can be ordered in more than one way I want to become a living god!