Difference between revisions of "Postgres"
From Bashlinux
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ |
__NOTOC__ |
||
+ | === How to install Postgres === |
||
− | = PostgreSQL = |
||
⚫ | |||
− | == Setup == |
||
+ | : '''CentOS'''<br> |
||
⚫ | |||
+ | # yum install postgresql postgresql-server |
||
− | |||
+ | : '''Ubuntu'''<br> |
||
− | <pre><nowiki> |
||
− | + | # apt-get install postgresql |
|
− | </nowiki></pre> |
||
+ | === How to initialize the DB === |
||
− | # Initialize DB |
||
⚫ | |||
− | |||
⚫ | |||
− | <pre><nowiki> |
||
⚫ | |||
⚫ | |||
− | + | > initdb -D /var/lib/pgsql/data |
|
⚫ | |||
⚫ | |||
− | </nowiki></pre> |
||
− | + | * Start postgres |
|
⚫ | |||
− | |||
− | <pre><nowiki> |
||
⚫ | |||
− | </nowiki></pre> |
Latest revision as of 02:00, 10 June 2015
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