terça-feira, 22 de março de 2016

ERROR: could not set permissions on directory on create tablespace

Still on my Postgres saga, I was trying to create a TABLESPACE on my pg instance. So, I created the folder for the brand new tablespace:

mkdir /var/lib/pgsql/data

On PgAdmin, I used the CREATE TABLESPACE command, right from the manual:

CREATE TABLESPACE pgmydata owner admin location '/var/lib/pgsql/data';

Bang, out of this simple command I got this:

ERROR:  could not set permissions on directory "/var/lib/pgsql/data"

The message is quite stratightfoward, but I always enjoy some searching before doing/changing anything (thats a good thing if you are a DBA).

After some usual googling, from the search results, stackoverflow answers always stand out. Not so much for the sake of StackOverflow per se, but there are some great individuals inputing great stuff there (some dickheads as well). So I found this:


So basically, all you need is to set the permissions to the postgres Linux user in your server to the desired folder. So I did:

chown postgres:postgres /var/lib/pgsql/data

And finally you can throw that create tablespace thing again, this time with no errors... =)

cheers!

Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

Nenhum comentário:

Postar um comentário

Leave your comment here!