anchor.diff:                                 end,
                                  ok = Module:sync(C)
                          end,
  -              lists:foreach(Insert, [null | Values])
  -      end).
  -
  -compare(_Type, null, null) -> true;
  -compare(float4, V1, V2)    -> abs(V2 - V1) < 0.000001;
  -compare(float8, V1, V2)    -> abs(V2 - V1) < 0.000000000000001;
  -compare(hstore, {V1}, V2)  -> compare(hstore, V1, V2);
  -compare(hstore, V1, {V2})  -> compare(hstore, V1, V2);
  -compare(hstore, V1, V2)    ->
  +              lists:foreach(Insert, [null, undefined | Values])
  +      end).
  +
  +compare(_Type, null, null)      -> true;
  +compare(_Type, undefined, null) -> true;
  +compare(float4, V1, V2)         -> abs(V2 - V1) < 0.000001;
  +compare(float8, V1, V2)         -> abs(V2 - V1) < 0.000000000000001;
  +compare(hstore, {V1}, V2)       -> compare(hstore, V1, V2);
  +compare(hstore, V1, {V2})       -> compare(hstore, V1, V2);
  +compare(hstore, V1, V2)         ->
       orddict:from_list(format_hstore(V1)) =:= orddict:from_list(format_hstore(V2));
   compare(Type, V1 = {_, _, MS}, {D2, {H2, M2, S2}}) when Type == timestamp;
                                                           Type == timestamptz ->
  
positive.code: format_hstore_key(Key) -> format_hstore_string(Key).
  
  format_hstore_value(null) -> null;
  format_hstore_value(Value) -> format_hstore_string(Value).
  
  format_hstore_string(Num) when is_number(Num) -> iolist_to_binary(io_lib:format("~w", [Num]));
  
negative.code:           Select(timestamp, [{{2008,1,2},{3,4,5.0}}, {{2008,1,2},{3,4,6.0}}]),
            Select(timestamptz, [{{2008,1,2},{3,4,5.0}}, {{2008,1,2},{3,4,6.0}}]),
            Select(interval, [{{1,2,3.1},0,0}, {{1,2,3.2},0,0}]),
            Select(hstore, [{[{null, null}, {a, 1}, {1, 2}, {b, undefined}]}]),
            Select(hstore, [[{[{null, null}, {a, 1}, {1, 2}, {b, undefined}]}, {[]}], [{[{a, 1}]}, {[{null, 2}]}]]),
            Select(cidr, [{{127,0,0,1}, 32}, {{0,0,0,0,0,0,0,1}, 128}]),
            Select(inet, [{127,0,0,1}, {0,0,0,0,0,0,0,1}])
        end).
  