diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-25 07:02:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-25 07:02:55 +0200 |
commit | d28d7cabb0896a93edf33123b1e83f4af632e5e5 (patch) | |
tree | 4bb3ba3dfcd0157bbeffce70c9f9d14686db4f00 | |
parent | 2db43d4c2f2bed0348d781367090e633ad02779f (diff) |
Don't try to translate duplicate primary key for auto-assigned id
An auto-assigned object id should never cause a duplicate primary key.
-rw-r--r-- | odb/pgsql/statement.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/odb/pgsql/statement.cxx b/odb/pgsql/statement.cxx index bd27243..c5e9662 100644 --- a/odb/pgsql/statement.cxx +++ b/odb/pgsql/statement.cxx @@ -756,7 +756,10 @@ namespace odb if (!is_good_result (h, &stat)) { - if (PGRES_FATAL_ERROR == stat) + // An auto-assigned object id should never cause a duplicate + // primary key. + // + if (returning_ == 0 && stat == PGRES_FATAL_ERROR) { string s (PQresultErrorField (h, PG_DIAG_SQLSTATE)); |