> or does this indicate an optimization that is not performed by PostgreSQL?
Yes, this is an optimization which PostgreSQL doesn't do.
PostgreSQL does not claim to implement every conceivable optimization, so this is not a bug. You are in the wrong forum. If you had working code to implement this, or a serious plan to write some, then pgsql-hackers would be the right place to go. But if you are just pointing out a curiosity, I doubt you would get much traction there. (I could be wrong, maybe there is some easy way to hook this into the same code used by GROUPING SETS which someone would be willing to do just based on your example, but I don't think so asGROUPING SETS produces extra rows, while I think this would need extra columns)