I wrote: > * It would be useful for the commentary to point out that in principle we > could pull up any immutable (or, probably, even just stable) expression; > but we don't, (a) for fear of multiple evaluations of the result costing > us more than we can save, and (b) because a primary goal is to let the > constant participate in further const-folding, and of course that won't > happen for a non-Const.
BTW, so far as I can see, none of the test cases demonstrate that such further const-folding can happen. Since this is all pretty processing- order-sensitive, I think an explicit test that that's possible would be a good idea. regards, tom lane