본문 바로가기
데이터베이스/Postgresql

[PostgreSQL] 개발db 환경 셋팅

by cbwstar 2021. 7. 26.
728x90
반응형

윈도우 설치 기준

윈도우에 설치후 원격에서 접속할수 있게

C:\Program Files\PostgreSQL\10\data\pg_hba.conf 파일 열어서 접속 허용아이 대역을 추가한다.

# replication privilege.
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5
host    all             all             0.0.0.0/0               md5            /*여기부분 추가 */

 

1. 접속 사용자 계정 생성

create user naqsifh password 'test' superuser;

create user naqscom password 'test' superuser;

 

2. 데이터 베이스 생성

create database naqs;

 

3. 사용자 권한주기

grant all privileges on database naqs to naqsifh;

grant all privileges on database naqs to naqscom;

 

4. 생성된 데이터 베이스 확인 

\list

 

5. TABLESPACE  생성

 생성할 폴더를 만든다.

c:\postgres_store\ifh_dat

c:\postgres_store\ifh_idx

c:\postgres_store\com_dat

c:\postgres_store\com_idx

 

create tablespace naqsifh_tbl owner naqsifh location 'c:\postgres_store\ifh_dat';

create tablespace naqsifh_idx owner naqsifh location 'c:\postgres_store\ifh_idx';

 

create tablespace naqscom_tbl owner naqscom location 'c:\postgres_store\com_dat';

create tablespace naqscom_idx owner naqscom location 'c:\postgres_store\com_idx';

 

6. schema 생성

create schema naqsifh authorization naqsifh;

create schema naqscom authorization naqscom;

 

 

 

 

728x90
반응형

댓글



"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."

loading