Postgresql Exception Handling In C