pgAdmin4 PostGIS PL/Python 설치

2025. 7. 13. 20:40DB/Postgres

반응형

1. pgAdmin4 설치

# 1. 필요한 패키지 설치
sudo apt-get install curl ca-certificates gnupg

# 2. pgAdmin4 공개 키 가져오기
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add -

# 3. 저장소 등록
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'

# 4. 패키지 목록 업데이트 및 설치
sudo apt update
sudo apt-get install pgadmin4-desktop

 

 

설치 후

pgadmin4

2. PostGIS 및 PL/Python 설치

 PostgreSQL 버전이 17이면 아래처럼 정확한 버전으로 설치

# PostGIS 설치
sudo apt install postgresql-17-postgis-3

# PL/Python 설치
sudo apt install postgresql-plpython3-17

버전이 다르면 설치가 실패하니 꼭 postgresql-17-xxx로 맞춰야 한다.

 


3.  확장 사용 설정 (옵션)

설치 후 특정 데이터베이스에 확장을 활성화하려면 psql에 접속 후 다음을 실행

-- PostGIS 활성화
CREATE EXTENSION postgis;

-- PL/Python 활성화
CREATE EXTENSION plpython3u;

 

4.  참고: /etc/postgresql/17/main 디렉토리

 

이 디렉토리는 PostgreSQL의 설정 파일들이 들어 있는 곳이다. 

postgresql.conf 주요 서버 설정 (포트, 로그, 메모리 등)
pg_hba.conf 클라이언트 접속 제어 설정
pg_ident.conf 사용자 매핑 설정 (잘 안 씀)

 

여기서 PostgreSQL 설정을 수정할 수 있다.


 

반응형