One of the RelationalDatabase. OpenSource. PostgreSQL

http://www.postgresql.org/

관련정보

기본명령

$ createuser postgres
$ dropuser postgres
$ createuser -s postgres
postgres=# create user yong27 with password '1234';
$ psql -U yong27
yong27=# alter user yong27 password '1234';
yong27=# create database mydb;

데이터 덤프 및 로드

pg_dump dbname > outfile
psql dbname < infile

각종 팁

pg_dump 시 -F c 옵션을 썼다면 psql로 로드되지 않는다 pg_restore로 해야함. 10배 정도 용량 절약효과


Django 1.4 는 PostgreSQL 9버전이 필요함. CentOS 등 yum 으로 설치하면 8버전임. 이를 9버전으로 설치하는 방법

http://yum.postgresql.org/repopackages.php 에 가서 운영체제에 맞는 파일을 받는다. 그리고,

rpm -ivh pgdg-centos92-9.2-6.noarch.rpm
yum groupinstall "PostgreSQL Database Server PGDG"
service postgresql-9.2 initdb
/etc/init.d/postgresql-9.2 start
PATH=$PATH:/usr/pgsql-9.2/bin pip install psycopg2


PostgreSQL 한글정렬이 잘 안되는 문제가 있음. LC_COLLATE="C" 환경설정 한 후, initdb 를 해야 한다고 함. http://tech.jinto.pe.kr/165 -- yong27 2014-01-27 10:17:28


CategoryProgram

PostgreSQL (last edited 2014-01-27 10:17:28 by 61)

web biohackers.net