From a6733021db61a87ebff94495d5b65d3ef521dd45 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Sep 2013 09:22:39 +0200 Subject: Fix UPDATE statement for smart containers with read-only value members Here we have to include them (think what happens when we erase an element somewhere in the middle of a container). --- odb/relational/pgsql/source.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'odb/relational/pgsql') diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index a7834a2..8a11914 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -1044,9 +1044,14 @@ namespace relational << "update_types[] =" << "{"; - statement_oids so (statement_where); + { + // Use insert instead of update to include read-only members. + // + statement_oids so (statement_insert); + so.traverse (m, vt, "value", "value"); + } - so.traverse (m, vt, "value", "value"); + statement_oids so (statement_where, false); so.traverse (m, idt, "id", "object_id"); switch (ck) -- cgit v1.1