summaryrefslogtreecommitdiff
path: root/odb/relational/pgsql/source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/pgsql/source.cxx')
-rw-r--r--odb/relational/pgsql/source.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx
index 8a11914..a287dd2 100644
--- a/odb/relational/pgsql/source.cxx
+++ b/odb/relational/pgsql/source.cxx
@@ -312,6 +312,19 @@ namespace relational
//
unsigned long long av (added (mi.m));
unsigned long long dv (deleted (mi.m));
+
+ // If the addition/deletion version is the same as the section's,
+ // then we don't need the test.
+ //
+ if (user_section* s = dynamic_cast<user_section*> (section_))
+ {
+ if (av == added (*s->member))
+ av = 0;
+
+ if (dv == deleted (*s->member))
+ dv = 0;
+ }
+
if (av != 0 || dv != 0)
{
os << "if (";
@@ -338,7 +351,18 @@ namespace relational
{
if (var_override_.empty ())
{
- if (added (mi.m) || deleted (mi.m))
+ unsigned long long av (added (mi.m));
+ unsigned long long dv (deleted (mi.m));
+ if (user_section* s = dynamic_cast<user_section*> (section_))
+ {
+ if (av == added (*s->member))
+ av = 0;
+
+ if (dv == deleted (*s->member))
+ dv = 0;
+ }
+
+ if (av != 0 || dv != 0)
os << "}";
}