Regarding PostgreSQL Documentation: https://www.postgresql.org/docs/current/protocol-error-fields.html, the Severity field contains one of this values: ERROR, FATAL, or PANIC.
Also here is a list of error code: https://www.postgresql.org/docs/current/errcodes-appendix.html
Where can I find the mapping between those error codes and the severity ?
Side question. would it make sense to stop a client microservice app when getting a FATAL or PANIC error type ?
I was expecting something like all error code between xxx and yyy --> ERROR. But can't be able to find something on the internet
You'd have to read the source to find what message level is used for which message, but the exercise would be pointless, since there is no rule. The same error message could be used with different message levels.
You need to understand the message levels.
FATALdoesn't mean that the message is worse thanERROR. It is the level used for an error that leads to the end of the database session. For example, connecting to a harmless, butFATALerror message, because that is the end of the connection attempt. The same message could be anERRORin aDROP DATABASEstatement.ERRORcan be much worse thanFATAL: think of data corruption.