แสดงบทความที่มีป้ายกำกับ PostgreSQL11 แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ PostgreSQL11 แสดงบทความทั้งหมด

วันศุกร์ที่ 12 เมษายน พ.ศ. 2562

Install PostgreSQL 11 on Ubuntu 18.04

การติดตั้ง PostgreSQL 11


*ถ้าไม่ต้องการติดตั้ง Version 11 จะลงตาม Version ที่มากับ Repository Linux ให้ข้ามไปตรง #Install PostgreSQL ได้เลยครับ

Official: PostgreSQL Installation
Reference: Install PostgreSQL, Install pgAdmin4, Getting Started
# Install PostgreSQL 
sudo apt update
sudo apt install wget gnupg2

Create the file /etc/apt/sources.list.d/pgdg.list and add repository
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
# Import repository signing key, then update package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update

# Install PostgreSQL, ถ้าไม่ทำตามขั้นตอนข้างบนจะติดตั้งตาม Version ที่มากับ Repository ของ Linux
sudo apt install postgresql postgresql-contrib

# Check PostgreSQL Status
sudo systemctl status postgresql

ทำการทดสอบโดยใช้ user postgres
# Connect to PostgreSQL
sudo su - postgres
psql
-- Show your connection information

\connifo
-- You are connected to database "postgres" as user "postgres" 
-- via socket in "/var/run/postgresql" at port "5432".

-- Show help
\?

-- Quit
\q