Postgres

From Bashlinux
Revision as of 02:00, 10 June 2015 by Manpaz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How to install Postgres

  • Install postgresql packages
CentOS
# yum install postgresql postgresql-server
Ubuntu
# apt-get install postgresql

How to 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