To debug a process or troubleshoot authentication issues in PostgreSQL, the pre_auth_delay parameter can be used to add a delay before a session is authenticated.
By adding a delay, it allows you to identify the problematic session and attach strace to it for further investigation.
The pre_auth_delay parameter can be changed online, and an example of setting it to 10 seconds is provided.
In addition to pre_auth_delay, there is also post_auth_delay parameter available.