[PostgreSQL] config

Younghwan Cha·2023년 7월 28일
0

Database

목록 보기
13/16
post-thumbnail

postgresql 을 사용할 때 생각보다 이것저것 설정할 부분들이 많이 생긴다.
이럴 때마다 찾아보는 나를 보고 개인적으로 정리해보려한다.
설정 파일들은 기본적으로 /etc/postgresql/<version/main/ 아래 경로에 저장되어있다.
자주쓰는 설정 파일들에 대해서 알아보자.

postgresql.conf


기본적으로 postgresql 에 대한 설정을 담당하는 파일이다. 파일을 확인해보면 아래와 같이 설정 파일들의 경로가 기입되어있다.

...

#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

data_directory = '/var/lib/postgresql/14/main'          # use data in another directory
                                        # (change requires restart)
hba_file = '/etc/postgresql/14/main/pg_hba.conf'        # host-based authentication file
                                        # (change requires restart)
ident_file = '/etc/postgresql/14/main/pg_ident.conf'    # ident configuration file
                                        # (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/14-main.pid'                   # write an extra PID file
                                        # (change requires restart)

[외부 서버에서도 접속 가능하도록 127.0.0.1:5432 => 0.0.0.0:5432] https://dejavuqa.tistory.com/32

pg_hba.conf


pg_hba.conf 파일은 PostgreSQL에 접속하는 클라이언트에 대한 인증 설정을 설명 하는 파일이다

경로

/etc/postgresql/<version/main/pg_hba.conf

Option

profile
개발 기록

0개의 댓글