Postgres runs on port 5432, this is the responsibility of the Post...

However did you know that listening socket isn’t created until another process finish running first?
That is startup process (ST), responsible for WAL redo when the database crashes.
You cannot allow clients to connect to the database if the state isn’t consistent. However some databases do allow clients to connect (SQL Server comes to mind) they just block them from doing anything, it is a design choice.
Where the backend meet databases, polish your skills and learn more about the fundamentals at courses.husseinnasser.com I would recommend starting with the OS course followed by network, backend then databases.

