I messed up my pgsql database by mistakenly deleting files on pg_wal
, it resulted to a non-recoverable state (with no backups to restore with) so i decided to run the pg_resetwal.exe -f
(considering the data loss).
After resetwal
, I ran: postgres -D /u01/pgsql/15/data
, and since wednesday (12/18/2024) and up to this date (12/20/2024) the startup is still running? Was this normal? How long does it usually take to finish starting-up? Or Should i terminate the running PID for the startup and rebuild the database from scratch?
Sample logs as of date:
2024-12-20 08:06:46.367 PST [826063] LOCATION: LogCheckpointStart, xlog.c:6099
2024-12-20 08:06:46.477 PST [826063] LOG: 00000: checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.102 s, sync=0.001 s, total=0.110 s; sync files=2, longest=0.001 s, average=0.001 s; distance=16380 kB, estimate=16383 kB
2024-12-20 08:06:46.477 PST [826063] LOCATION: LogCheckpointEnd, xlog.c:6188
6
The server is actually up and running. If it is performing checkpoints rather than restartpoints, PostgreSQL is done with recovery, and you can connect.
You should start the server with pg_ctl
rather than postgres
if you want to run it in the background.