log postgresql error context if it is available