[FIX] logging PostgreSQLHandler: expand message + use contextmanagers to handle exceptions and cursor
Subtree merged in odoo/master