Postgres

From Bashlinux
Revision as of 03:23, 3 June 2015 by Manpaz (talk | contribs)
Jump to: navigation, search


How to install and initialize postgres

  • Install postgresql packages

CentOS

# yum install postgresql postgresql-server

Ubuntu

# apt-get install postgresql
  • Initialize the DB
# mkdir /var/lib/pgsql/data
# chown postgres /var/lib/pgsql/data
# su - postgres
> initdb -D /var/lib/pgsql/data  
  • Start postgres
# pg_ctl -D /usr/local/pgsql/data -l -logfile start