3 ms·
A big advantage of the process-based model is its resilience against many classes of errors. If a bug in PostgreSQL (or in an extension) causes the server to c
by newaccount74 3y ago
A big advantage of the process-based model is its resilience against many classes of errors.
If a bug in PostgreSQL (or in an extension) causes the server to crash, then only that process will crash. Postmaster will detect the child process termination, and send an error message to the client. The connection will be lost, but other connections will be unaffected.
It's not foolproof (there are ways to bring the whole server down), but it does protect against many error conditions.
It is possible to trap on some exceptions in a threaded environment, but cleaning up after eg. an attempted NULL pointer dereference is going to be very difficult or impossible.
- anarazel 3y agoWe would still have a separate supervisor process of we moved connections to threads.