PostgreSQL 도 마찬가지로 그 작업을 해줘야 하는데, 그 명령어가 initdb 이다.
위치는 $PG/bin/initdb 에 있다.
% initdb -D $PG/data
실행을 하면, db 가 생성되는 과정 메세지가 출력되는데, 너무 빨라서 휘리릭 출력된다.
The files belonging to this database system will be owned by user "ck0911.kim". This user must also own the server process. The database cluster will be initialized with locale "ko_KR.UTF-8". The default database encoding has accordingly been set to "UTF8". initdb: could not find suitable text search configuration for locale "ko_KR.UTF-8" The default text search configuration will be set to "simple". Data page checksums are disabled. creating directory /home/ck0911.kim/postgresql/data ... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /home/ck0911.kim/postgresql/data -l logfile start |
※ initdb 실행할 때, 아래와 같이 인코딩 관련 옵션들을 설정할 수 있다.
initdb -E UTF-8 --locale=ko_KR.UTF-8 --lc-collate=C -D data
나중에 좀 더 알아보도록 한다.
출처
https://www.postgresql.org/docs/current/static/creating-cluster.html
https://tedwon.atlassian.net/wiki/spaces/SE/pages/1212988/PostgreSQL
댓글 없음:
댓글 쓰기