This commit is contained in:
Adam D. Ruppe 2019-04-03 10:01:45 -04:00
parent e9a140928b
commit 10d65d0367
5 changed files with 196 additions and 16 deletions

View file

@ -81,6 +81,8 @@ class PostgreSql : Database {
auto res = PQexec(conn, toStringz(sql));
int ress = PQresultStatus(res);
// https://www.postgresql.org/docs/current/libpq-exec.html
// FIXME: PQresultErrorField can get a lot more info in a more structured way
if(ress != PGRES_TUPLES_OK
&& ress != PGRES_COMMAND_OK)
throw new DatabaseException(error());