Paul Mamin <pm@sky.ru> writes:
> And when result is not empty - everything's Ok.
> But when it's empty then [ backend crashes ]
I can reproduce this bug with the current development sources.
Will look into it. A quick look at a backtrace suggests that
the problem is triggered by the "sum(int8(inb))>=maxinb" part
of the HAVING clause. You might be able to work around it if
you can use int4 or float instead of int8 ...
regards, tom lane