Specialized ConnectionError for PostgreSQL with detailed error information.
bool is_not_null_violation() const
Check if this is a not-null violation.
bool is_foreign_key_violation() const
Check if this is a foreign key violation.
bool is_check_constraint_violation() const
Check if this is a check constraint violation.
static PostgreSQLError from_libpq(int pg_error_code, std::string_view error_msg)
Create an error from a libpq error code and message.
std::string constraint_name
PostgreSQLErrorCode error_code
bool is_duplicate_key_error() const
Check if this is a duplicate key error.
static PostgreSQLError from_sql_state(std::string_view sql_state, std::string_view error_msg)
Create an error from a SQLSTATE code.
std::string formatted_message() const
Get a user-friendly error message.