I decided to to run PostgreSQL on my Fedora 20, so I did
sudo yum install postgresql-server.x86_64 postgresql-libs.x86_64 postgresql.x86_64
Now if I do
postgres -D /var/lib/pgsql/data under regular user I receive
Permission denied for "/var/lib/pgsql/data/postgresql.conf", if I try it under root I get some error about that I shouldn't run postgres under the privileged user.
I understand these two errors, but now it's getting weird -
sudo -u postgres postgres -D /var/lib/pgsql/data gives me error I am missing
postgresql.conf - if I create it under root (because root owns the directory) it again complains about permissions during startup. If I try to run
initdb -D /var/lib/pgsql/data it doesn't work too because if improper rights (dir is owned by root).
So I am really not sure what I am supposed to do, is there anything that I have done wrong? Because everything in
/var/lib/ is owned by root and it's default place for configuration in Fedora (at least for postgres) so it seems to me really messed up.