ทุกครั้งที่เปิดเครื่องใหม่จะเกิดปัญหาซ้ำๆ แต่รอบนี้แก้วิธีเดิมก็ยังไม่สามารถใช้งานได้
2024-10-02 10:51:19.809 +07 [15844] LOG: database system was interrupted; last known up at 2024-10-02 10:10:03 +07

- SQL - Database-1.png (19.86 KiB) Viewed 1191 times
ผ่าน command
C:\WINDOWS\system32>"C:\Program Files\PostgreSQL\12\bin\pg_ctl.exe" -D "C:\Program Files\PostgreSQL\12\data" start
waiting for server to start....2024-10-02 11:04:36.526 +07 [13260] LOG: starting PostgreSQL 12.3, compiled by Visual C++ build 1914, 64-bit
2024-10-02 11:04:36.528 +07 [13260] LOG: listening on IPv6 address "::", port 5449
2024-10-02 11:04:36.528 +07 [13260] LOG: listening on IPv4 address "0.0.0.0", port 5449
2024-10-02 11:04:36.726 +07 [13260] LOG: redirecting log output to logging collector process
2024-10-02 11:04:36.726 +07 [13260] HINT: Future log output will appear in directory "log".
........................................................... stopped waiting
pg_ctl: server did not start in time
ตรวจสอบในไฟล์ postmaster.pid กับ ใน services ไม่มีใช้งาน13260 อยู่

- SQL - Database-1.png (38.84 KiB) Viewed 1186 times
พอ start อีกรอบ ขึ้นว่ามีไฟล์ postmaster.pid ซ้ำ
C:\WINDOWS\system32>"C:\Program Files\PostgreSQL\12\bin\pg_ctl.exe" -D "C:\Program Files\PostgreSQL\12\data" start
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....2024-10-02 11:10:31.107 +07 [17028] FATAL: lock file "postmaster.pid" already exists
2024-10-02 11:10:31.107 +07 [17028] HINT: Is another postmaster (PID 13260) running in data directory "C:/Program Files/PostgreSQL/12/data"?
stopped waiting
pg_ctl: could not start server
Examine the log output.
พอลบไฟล์ postmaster.pid ออกก็กลับไปลูปเดิม และ อยู่ๆก็สามารถใช้งานได้
อ้างอิง
https://stackoverflow.com/questions/645 ... art-server