본문 바로가기

RDBMS/PostgreSQL

(3)
Postgresql data 경로 변경 Postgresql을 설치한 후 기본으로 설정되어 있는 data 경로를 변경해보도록 하겠습니다. 앞에서 설치했던 postgresql-11을 기준으로 변경하겠습니다. 1. psql 명령어를 통해 Postgresql 데이터 베이스에 접속한 후 데이터 경로를 확인합니다. postgres=# show data_directory; 명령어를 사용해서 데이터 경로를 확인할 수 있습니다. initdb를 통해 postgres를 초기화 할 때, 별 다른 경로를 지정해주지 않으면 위 사진처럼 /var/lib/pgsql/~ 경로에 데이터 경로가 생기게 됩니다. 2. 다음 postgresql를 중단합니다. systemctl stop postgresql-11 3. postgresql을 중단한 후 설정파일을 수정합니다. postm..
Postgresql 간단 명령어 ( + psql 명령어 ) psql 명령어 psql - localhost의 5432 port로 Postgresql에 접속합니다. postgres 계정으로 실행 시 postgres 아이디로 접속 psql -U test - localhost의 5432 port로 Postgresql에 접속합니다. -U 뒤에 붙여지는 아이디로 접속 ( test 계정으로 접속 ) psql -U test -d testdb - localhost의 5432 port, test계정의 testdb database로 접속합니다. -U ID명, -d DB명 psql -p 1234 -U test -d testdb - localhost의 1234 port, test 계정의 testdb database로 접속합니다. -p port 번호, -U ID명, -d DB명 psql..
Postgresql 설치 ( Linux ) 1. Postgresql 설치 Postgresql 11버전을 설치하기 위해 repository를 먼저 적용합니다. 아래 명령어를 실행하면 repository가 적용됩니다. sudo rpm -Uvh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm 이후 yum repolist 명령어를 사용하여 확인해보면 위 사진과 같이 적용한 결과가 나옵니다. 9.6 ~ 13 버전까지 repolist가 등록되었습니다. 성공적으로 repolist가 적용되었다면, 이제 postgresql 11버전을 설치하도록 하겠습니다. yum install postgresql11-server postgresq..