// PostgreSQL Versions

PostgreSQL Versions

PostgreSQL ออก Major Version ใหม่ทุกปีในช่วง Q3-Q4 พร้อม Minor Patches สำหรับ Bug Fix และ Security อย่างสม่ำเสมอ

// Release Policy

Versioning Policy

📅
Major Version ทุกปี
PostgreSQL ออก Major Version ใหม่ทุกปี มักในช่วง กันยายน-ตุลาคม แต่ละ Major Version รองรับ 5 ปี
🔧
Minor Patch เป็นประจำ
Minor Versions (เช่น 17.1, 17.2) ออกทุกๆ 3 เดือน ประกอบด้วย Bug Fix และ Security Patches เท่านั้น
⚠️
EOL หลัง 5 ปี
แต่ละ Major Version มี End of Life หลังจาก 5 ปี ควร Upgrade ก่อน EOL เพื่อรับ Security Updates
// Current Versions

เวอร์ชันที่รองรับ

VersionRelease DateEnd of LifeStatusFeatures หลัก
PostgreSQL 17 Sept 2024 Nov 2029 Current Incremental Sort improvements, JSON_TABLE, SQL/JSON constructors, MERGE enhancements
PostgreSQL 16 Sept 2023 Nov 2028 Supported Logical Replication enhancements, SQL/JSON, Parallel Queries ดีขึ้น, pg_stat_io
PostgreSQL 15 Oct 2022 Nov 2027 Supported MERGE command (SQL:2016), Improved Sorting, pg_walinspect, JSON Log
PostgreSQL 14 Sept 2021 Nov 2026 Supported Multirange Types, Pipeline Mode, JSON Subscripting, B-Tree Index improvements
PostgreSQL 13 Sept 2020 Nov 2025 Near EOL Partitioning improvements, Parallel Vacuum, B-Tree deduplication
PostgreSQL 12 Oct 2019 Nov 2024 EOL Generated Columns, CTE improvements, Partitioning improvements
// PostgreSQL 17 Highlights

🏆 PostgreSQL 17 — Features ใหม่

📊
JSON_TABLE
สร้าง Relational View จาก JSON Data ได้ง่ายด้วย SQL Standard JSON_TABLE Function
Incremental Sort
ปรับปรุง Sort Performance เมื่อข้อมูลบางส่วน Sorted อยู่แล้ว ลด Memory ใช้
🔄
MERGE Improvements
MERGE Statement รองรับ RETURNING clause และ Subqueries เพิ่มเติม
🗃️
Vacuum Improvements
VACUUM ทำงานเร็วขึ้น ลด I/O และ Lock Contention ใน Large Tables
📡
Logical Replication Slot
ปรับปรุง Failover สำหรับ Logical Replication Slots
🔐
pg_hba_file_rules
View ใหม่สำหรับตรวจสอบ Authentication Rules ได้ง่ายขึ้น
// Upgrade

วิธี Upgrade PostgreSQL

-- ตรวจสอบ Version ปัจจุบัน SELECT version(); -- Upgrade ด้วย pg_upgrade (Major Version) $ pg_upgrade \ -d /var/lib/postgresql/16/main \ -D /var/lib/postgresql/17/main \ -b /usr/lib/postgresql/16/bin \ -B /usr/lib/postgresql/17/bin \ --check -- ใช้ Logical Replication สำหรับ Zero-Downtime Upgrade -- 1. Setup Replica ด้วย New Version -- 2. Sync ข้อมูลผ่าน Logical Replication -- 3. Switchover เมื่อ Lag = 0
ต้องการข้อมูลเพิ่มเติมเกี่ยวกับ PostgreSQL?
เรียนรู้ Data Types, Extensions และ Performance Tuning สำหรับ PostgreSQL