관리 메뉴

Sysops Notepad

[Linux] PostgreSQL 13 설치 본문

업무/etc

[Linux] PostgreSQL 13 설치

sysops 2021. 11. 15. 00:23
728x90

설치환경 :

- Centos 7

 

설치방법 

[root@sysops]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
[root@sysops]# yum install -y postgresql13-server
[root@sysops]# /usr/pgsql-13/bin/postgresql-13-setup initdb
[root@sysops]# systemctl enable postgresql-13

사용방법

[root@sysops]# sudo -iu postgres psql
# CREATE DATABASE test;
# \c test
# CREATE TABLE messages (handle VARCHAR(32), message VARCHAR(280));
# INSERT INTO messages VALUES ('User', 'This is a test message.');
# INSERT INTO messages VALUES ('User', 'This is another test message.');
# SELECT * FROM messages;

 

참고 : https://www.vultr.com/docs/install-postgresql-on-centos-7

728x90
Comments