SKKU SW/Database

[DataBase] PostgreSQL 설치 & 명령어

효딩 2024. 3. 3. 20:47

PostgreSQL이란?

객체 관계형 데이터베이스(ORDBMS) 중 하나로 무료로 제공되고 있는 데이터베이스

실제 기능적인 면에서 Oracle과 유사한 것이 많아, Oracle 사용자들이 가장 쉽게 적응할 수 있는 오픈소스 DBMS라고 평가할 수 있음.

앱을 설치하면 나오는 공식 문서?에는 이렇게 적혀 있다.

PostgreSQL is an open-source descendant of this original Berkeley code. It supports a large part of the SQL standard and offers many modern features:

  • complex queries
  • foreign keys
  • triggers
  • updatable views
  • transactional integrity
  • multiversion concurrency control

Also, PostgreSQL can be extended by the user in many ways, for example by adding new

  • data types
  • functions
  • operators
  • aggregate functions
  • index methods
  • procedural languages

And because of the liberal license, PostgreSQL can be used, modified, and distributed by anyone free of charge for any purpose, be it private, commercial, or academic.

PostgreSQL 15.4 Documentation

필요할 때 참고하면 좋을듯

설치 방법은 해당 블로그를 참고했다.

https://backendcode.tistory.com/225

 

PostgreSQL 설치 및 세팅 & pgAdmin 사용법 - Windows

이번 글에서는 PostgreSQL 설치 방법과 초기 세팅, pgAdmin을 사용해 Database 생성 및 User 생성에 대해 정리할 것입니다. 우선 pgAdmin이란 PostgreSQL을 설치했을 때 기본적으로 설치되는 것이고, PostgreSQL을

backendcode.tistory.com

명령어는 터미널에 입력

# psql 접속 및 로그인

$ psql -h localhost -U userName

- 명령어

-d name, --dbname name: name of database

-f name, --file name: use name as the source of commands

\l: list existing databases

\c db_name: connect to a database name

\d: list all tables (display)

\d table: show information about a table

\i file_name: read file into query buffer

\q: quit the program

\! Command: execute the Linux command