Heikki Linnakangas <hlinn...@iki.fi> writes: > I bumped into a little bug in BRIN, while hacking on something > unrelated. This causes a segfault, or an assertion failure if assertions > are enabled:
Good catch. > Fix attached. Hm, I don't particularly care for directly comparing Datum values like that. We don't do that elsewhere (I think) and it feels like a type violation to me. Since you've already tested for !attbyval, I think it'd be legitimate to extract the pointer values and compare those, eg if (!attr->attbyval && DatumGetPointer(result) != DatumGetPointer(column->bv_values[INCLUSION_UNION])) I realize that this makes no difference in terms of the machine code (at least for most machines?) but it avoids breaking the Datum abstraction. regards, tom lane