From f97cf788bb37f978d42ed4dba5874d3d74830e2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jul 2012 16:04:12 +0200 Subject: Handle special case of array of zero elements --- odb/relational/pgsql/source.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index c1ca854..d4c67d3 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -718,6 +718,13 @@ namespace relational statement_oids st (statement_insert); st.traverse (c); + // Empty array are not portable. So add a dummy member if we + // are not sending anything with the insert statement. + // + if (cc.total == cc.inverse + cc.optimistic_managed + + (id != 0 && !poly_derived && auto_ (*id) ? cc.id : 0)) + os << "0"; + os << "};"; } -- cgit v1.1