PostgreSQL: add handler for error/close event

Signed-off-by: swpd <swpdtz@gmail.com>
PostgreSQL: update README.md to explain the usage

Signed-off-by: swpd <swpdtz@gmail.com>