mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
Recognize another PostgreSQL error as "no_privilege"
Map error 25006 ("cannot execute INSERT in a read-only transaction")
to "no_privilege" category as this means that the database is in
read-only mode, i.e. we don't have the privileges for changing it.
This commit is contained in:
@@ -30,7 +30,8 @@ soci_error::error_category postgresql_soci_error::get_error_category() const
|
||||
{
|
||||
return connection_error;
|
||||
}
|
||||
else if (std::memcmp(sqlstate_, "42501", 5) == 0)
|
||||
else if (std::memcmp(sqlstate_, "42501", 5) == 0 ||
|
||||
std::memcmp(sqlstate_, "25006", 5) == 0)
|
||||
{
|
||||
return no_privilege;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user