Andrew Dunstan <andrew@dunslane.net> writes:
> OK, drawing this together, what I did was to go back closer to my
> original idea, but put this in a separate function, so nobody would get
> too upset ;-)
This seems seriously ugly. Why don't you have the flag just driving
your original two-line addition?
regards, tom lane