PostgreSQL 이란?
오픈소스 객체-관계형 데이터 베이스 시스템 (ORDBMS)
다른 관계형 데이터베이스와 다르게, 연산자, 복합 자료형, 집게 함수, 자료형 변환자, 확장 기능등
다양한 데이터베이스 객체를 사용자가 임의로 만들 수 있는 기능이 있어서,
마치 새로운 하나의 프로그래밍 언어처럼 무한한 기능을 손쉽게 구현할 수 있다.
PostgreSQL 설치하기
( 윈도우 / Mac )
PostgreSQL: Downloads
Downloads PostgreSQL Downloads PostgreSQL is available for download as ready-to-use packages or installers for various platforms, as well as a source code archive if you want to build it yourself. Packages and Installers Select your operating system family
www.postgresql.org
( 리눅스 / 우분투 )
sudo apt install postgresql
pgAdmin4 란?
PostgreSQL 데이터베이스를 GUI로 손쉽게 관리할 수 있는 도구
pgAdmin4 설치하기 ( 윈도우 )
Download
pgAdmin 4 (Windows) Download Maintainer: pgAdmin Development Team pgAdmin is available for 64 bit Windows™ 7 SP1 (desktop) or 2008R2 (server) and above, up to v4.30. v5.0 and later are supported on Windows 8 (desktop) or 2012 (server) and above. 32 bit W
www.pgadmin.org
pgAdmin4 설치하기 ( 우분투 )
# 우분투 설치
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
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 && apt update'
sudo apt install pgadmin4
PostgreSQL 사용하기 위해 초기 설정하기
// postgres 명령창(shell) 접속
sudo -u postgres psql
// 사용자 계정 만들기 ( 옵션을 추가할 수 있음 )
CREATE USER <이름> PASSWORD '<비밀번호>' SUPERUSER;
// PASSWORD : 비밀번호 설정
// SUPERUSER : 관리자 권한 부여
// 전체 사용자 조회하기
SELECT * FROM PG_SHADOW;
\dg, \du
// 사용자 전용 DB 만들기
CREATE DATABASE <이름> OWNER <사용자>;
// DB 확인하기
\l
// postgres 명령창 나가기
\q
// 사용자 전용 DB에 접속하기
psql -h localhost -p 5432 -U <사용자> -d <DB>;
// -h : 호스팅 주소 설정
// -p : 호스팅 포트 설정
// -U : 사용할 사용자 설정
// -d : 사용할 DB 설정
pgAdmin4 Desktop에서, PostgreSQL 연결하기
1. pgAdmin4 Desktp 실행하기

2. PostgreSQL과 연결하기 위해 서버 만들기

3. 사용할 이름과 설명 적기

4. 연결할 database와 주소, 사용자 이름, 패스워드 적기

5. 연결 완료

PostgreSQL 명령어
[PostgreSQL] 자주 사용하는 명령어
database 리스트 확인하기 \l database 생성, 삭제 // 데이터베이스 생성 CREATE DATABASE 데이터베이스; // 데이터베이스 삭제 DROP DATABASE 데이터베이스; 사용자 생성, 삭제 // 사용자 만들기 CREATE USER 사..
defineall.tistory.com
PostgreSQL 이란?
오픈소스 객체-관계형 데이터 베이스 시스템 (ORDBMS)
다른 관계형 데이터베이스와 다르게, 연산자, 복합 자료형, 집게 함수, 자료형 변환자, 확장 기능등
다양한 데이터베이스 객체를 사용자가 임의로 만들 수 있는 기능이 있어서,
마치 새로운 하나의 프로그래밍 언어처럼 무한한 기능을 손쉽게 구현할 수 있다.
PostgreSQL 설치하기
( 윈도우 / Mac )
PostgreSQL: Downloads
Downloads PostgreSQL Downloads PostgreSQL is available for download as ready-to-use packages or installers for various platforms, as well as a source code archive if you want to build it yourself. Packages and Installers Select your operating system family
www.postgresql.org
( 리눅스 / 우분투 )
sudo apt install postgresql
pgAdmin4 란?
PostgreSQL 데이터베이스를 GUI로 손쉽게 관리할 수 있는 도구
pgAdmin4 설치하기 ( 윈도우 )
Download
pgAdmin 4 (Windows) Download Maintainer: pgAdmin Development Team pgAdmin is available for 64 bit Windows™ 7 SP1 (desktop) or 2008R2 (server) and above, up to v4.30. v5.0 and later are supported on Windows 8 (desktop) or 2012 (server) and above. 32 bit W
www.pgadmin.org
pgAdmin4 설치하기 ( 우분투 )
# 우분투 설치
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
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 && apt update'
sudo apt install pgadmin4
PostgreSQL 사용하기 위해 초기 설정하기
// postgres 명령창(shell) 접속
sudo -u postgres psql
// 사용자 계정 만들기 ( 옵션을 추가할 수 있음 )
CREATE USER <이름> PASSWORD '<비밀번호>' SUPERUSER;
// PASSWORD : 비밀번호 설정
// SUPERUSER : 관리자 권한 부여
// 전체 사용자 조회하기
SELECT * FROM PG_SHADOW;
\dg, \du
// 사용자 전용 DB 만들기
CREATE DATABASE <이름> OWNER <사용자>;
// DB 확인하기
\l
// postgres 명령창 나가기
\q
// 사용자 전용 DB에 접속하기
psql -h localhost -p 5432 -U <사용자> -d <DB>;
// -h : 호스팅 주소 설정
// -p : 호스팅 포트 설정
// -U : 사용할 사용자 설정
// -d : 사용할 DB 설정
pgAdmin4 Desktop에서, PostgreSQL 연결하기
1. pgAdmin4 Desktp 실행하기

2. PostgreSQL과 연결하기 위해 서버 만들기

3. 사용할 이름과 설명 적기

4. 연결할 database와 주소, 사용자 이름, 패스워드 적기

5. 연결 완료

PostgreSQL 명령어
[PostgreSQL] 자주 사용하는 명령어
database 리스트 확인하기 \l database 생성, 삭제 // 데이터베이스 생성 CREATE DATABASE 데이터베이스; // 데이터베이스 삭제 DROP DATABASE 데이터베이스; 사용자 생성, 삭제 // 사용자 만들기 CREATE USER 사..
defineall.tistory.com