I had a thought about this: I don't think EXPLAIN is ever required
to print the names of join alias variables (since the planner flattens
all join alias variables to some kind of expression over their
underlying columns). So we could skip assigning column names to
join RTEs at all, if we know that it's EXPLAIN rather than view/rule
decompilation. That might let us skip all the mess around
unique-ifying JOIN USING column names, too.
regards, tom lane