From 13102d6772ff32f3bcb53479038e979c5bd9a498 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Apr 2012 09:04:35 +0200 Subject: Fix auto id handling in polymorphic objects --- odb/relational/pgsql/source.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'odb/relational/pgsql') diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index c868df2..7bb2f8a 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -611,7 +611,10 @@ namespace relational semantics::data_member* id (id_member (c)); - if (id != 0 && id->count ("auto")) + type* poly_root (polymorphic (c)); + bool poly_derived (poly_root != 0 && poly_root != &c); + + if (id != 0 && !poly_derived && id->count ("auto")) { os << endl << strlit (" RETURNING " + column_qname (*id)); -- cgit v1.1