diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-28 11:18:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-28 11:18:54 +0200 |
commit | f3e83073310e5fbafb142bb8d3cd1b03ed6088e9 (patch) | |
tree | b5dff90ee11e188a32e15defcdd7e0caa846f48e /odb/pgsql/object-statements.hxx | |
parent | c83c53f3cea54b62d1d90d298dccafcda37d5297 (diff) |
Implement returning of auto id using RETURNING clause in PostgreSQL
Before we used a separate SELECT lastval() query which was both inefficient
and error-prone in cases where INSERT may cause triggers to override the
last value.
Diffstat (limited to 'odb/pgsql/object-statements.hxx')
-rw-r--r-- | odb/pgsql/object-statements.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/odb/pgsql/object-statements.hxx b/odb/pgsql/object-statements.hxx index 6942361..2a26cce 100644 --- a/odb/pgsql/object-statements.hxx +++ b/odb/pgsql/object-statements.hxx @@ -265,7 +265,8 @@ namespace odb object_traits::persist_statement_types, insert_column_count, insert_image_binding_, - insert_image_native_binding_)); + insert_image_native_binding_, + object_traits::auto_id)); } return *persist_; @@ -522,7 +523,8 @@ namespace odb object_traits::persist_statement_types, insert_column_count, insert_image_binding_, - insert_image_native_binding_)); + insert_image_native_binding_, + false)); } return *persist_; |