[Users] About owner of postgres

Stephen Liu satimis at yahoo.com
Sun Nov 11 08:07:55 UTC 2012



> From: Juan Hernandez <jhernand at redhat.com>
>To: Stephen Liu <satimis at yahoo.com> 
>Cc: "users at ovirt.org" <users at ovirt.org> 
>Sent: Sunday, November 11, 2012 3:01 AM
>Subject: Re: [Users] About owner of postgres


- snip -


>Assuming that you don't have the data of any other application in that
>PostgreSQL instance I would remove it completely and then create it
>again running the following commands as root:
>
>systemctl stop postgresql.service
>rm -rf /var/lib/pgsql
>postgresql-setup initdb
>systemctl start postgresql.service
>
>That will give you a clean instance of PosrgreSQL that you can use for
>the ovirt-engine installation.
>
>Let us know if this helps.

Your advice worked for me.  Thanks.


Steps performed as follows:-
# systemctl stop postgresql.service

# rm -rf /var/lib/pgsql
# postgresql-setup initdb
Initializing database ... OK

# systemctl start postgresql.service

# chkconfig postgresql on
Note: Forwarding request to 'systemctl enable postgresql.service'.
ln -s '/usr/lib/systemd/system/postgresql.service' '/etc/systemd/system/multi-user.target.wants/postgresql.service'


A further question;

I can change the owner of postgresql in following ways;

1)
# chown satimis satimis /var/lib/pgsql/


OR
2)
sudo su - postgres
initdb -E UTF8

$ createuser -s -U postgres
$ Enter name of role to add: {{ satimis }}


Would there is any difference?

If there is.  After having finished the current test I can start a new test on another hard drive.


Besides:
on
http://wiki.ovirt.org/wiki/Installing_PostgreSQL_DB
Connecting to the database 

Run /etc/init.d/postgresql restart (it didn't work)

to be replaced with:
service postgresql restart



More information about the Users mailing list