จากบทความ เช็คเวอร์ชั่น ฐานข้อมูล คำสั่ง หา Version ของ PGSQL ที่เราใช้งานอยู่ วิธีนี้ใช้ได้เฉพาะติดตั้ง PostgreSQL ไว้ในเครื่องไว้เวอร์ชั่นเดียว
แต่ถ้าได้ติดตั้ง PostgreSQL ไว้หลายเวอร์ชั่น
สามารถใช้วิธีตามด้านล่างนี้
Command เช็คเวอร์ชั่น บน Ubuntu
โค้ด: เลือกทั้งหมด
grep -H '^port' /etc/postgresql/*/main/postgresql.conf
/etc/postgresql/10/main/postgresql.conf:port = 541x # (change requires restart)
/etc/postgresql/9.1/main/postgresql.conf:port = 567x # (change requires restart)
/etc/postgresql/9.6/main/postgresql.conf:port = 543x # (change requires restart)