/* 최대한 한글 없이 필요한 내용만 작성하는 포스팅입니다. */


1. Add PostgreSQL repository


(root)


01) vi /etc/apt/sources.list.d/pg.list


#writing

deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main

#:wq 


02) apt-get update 

....

The following signatures couldn't be verified because the public key is not available : NO_PUBKEY AAAAAAAAAA

....

# solution : apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AAAAAAAAAA


retry command : apt-get update


2. Install PostgreSQL using apt-get


(root)


01) apt-cache search postgresql


02) apt-get install ....


$ dpkg -l | grep postgresql

ii  postgresql-9.3                             9.3.5-1.pgdg12.4+1              object-relational SQL database, version 9.3 server

ii  postgresql-9.3-postgis-2.1             2.1.4+dfsg-1.pgdg12.4+2      Geographic objects support for PostgreSQL 9.3

ii  postgresql-9.3-postgis-2.1-scripts  2.1.4+dfsg-1.pgdg12.4+2      PostGIS for PostgreSQL 9.3 -- scripts -- dummy package

ii  postgresql-9.3-postgis-scripts        2.1.4+dfsg-1.pgdg12.4+2      Geographic objects support for PostgreSQL 9.3 -- scripts

ii  postgresql-client-9.3                     9.3.5-1.pgdg12.4+1              front-end programs for PostgreSQL 9.3

ii  postgresql-client-common             154.pgdg12.4+1                    manager for multiple PostgreSQL client versions

ii  postgresql-common                       154.pgdg12.4+1                    PostgreSQL database-cluster manager

ii  postgresql-contrib-9.3                   9.3.5-1.pgdg12.4+1              additional facilities for PostgreSQL


3. Add user to PostgreSQL


(root)


01) su - postgres


(postgres)


02) createuser test_user_name -s 

# -s option : super user


03) psql

....

   ALTER user test_user_name with password 'PW';

   ctrl + d 

   #exit

....


(root) 


04) vi /etc/postgresql......../.../.../postgresql.conf


#change 

....

listen_addresses = 'localhost'

#remove comment #


#or       listen_addresses = 'PostgreSQL_server_IP_Address'

#          vi ..../pg_hba.conf

#          ....

#          host all all allow_IP_Address/24 trust  #---> example

#          ....

....


05) service postgresql restart



+ Recent posts