레이블이 PostgreSQL인 게시물을 표시합니다. 모든 게시물 표시
레이블이 PostgreSQL인 게시물을 표시합니다. 모든 게시물 표시

2015년 1월 22일 목요일

console commands with linux

psql -h host -p 5432 -U username database

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first

yum install postgresql-server

[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql start

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
                                                           [FAILED]
[root@localhost kamailio-4.2.2]# service postgresql initdb
Initializing database:                                     [  OK  ]
[root@localhost kamailio-4.2.2]# /etc/init.d/postgresql restart
Stopping postgresql service:                               [  OK  ]
Starting postgresql service:                               [  OK  ]
[root@localhost kamailio-4.2.2]#

2015년 1월 15일 목요일

backup & restore with postgresql

1. Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
2. Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}

2014년 2월 16일 일요일

postgresql manual uninstall at OS X

[ Envirenment ]
- OS X : 10.9.1
- postgresql 8.4.19-2

[ Method ]
- 아래와 같이 처리 한다
sudo /sbin/SystemStarter stop postgresql-8.4
sudo rm -rf /Applications/PostgreSQL\ 8.4
sudo rm -rf /etc/postgres-reg.ini
sudo rm -rf /Library/StartupItems/postgresql-8.4
sudo rm -rf /Library/PostgreSQL/8.4
sudo dscl . delete /users/postgres

- reboot

[ Origin ]
- http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x

2012년 4월 9일 월요일

PostgreSQL 상태 체크

아직 써보진 않았지만, 백업용으로...

select * from pg_locks
select * from pg_stat_activity

2011년 10월 20일 목요일

PostgreSQL 에서 원격지 접속 허용 하기

pgAdmin III 의 Tools - Server Configuration - pg_hba.conf 를 사용해서 추가 하니 잘 안된다 ( 9.1 버전인데, Tool 버그가 있는 것 같다 )
걍 PosgresSQL 의 Data 위치에 보면 pg_hba.conf 파일이 있는데 직접 아래와 같이 집어 넣는다.

[ 모든 IP 허용 ]
host all all 0.0.0.0/0 password

그리고 pgAdmin III 의 Tools - Server Configuration - pg_hba.conf 를 열고 Reload Server 버튼을 한번 눌러준다

그리고 원격에서 접속해 보기

[ linux ]
위치 : /var/lib/pgsql/data내용 : host   all   all   192.168.1.0/16   md5