Does temp tables also suffer from optimization fence we see in CTE.
I suppose it depends on how they end up being referenced in the query. It is not possible for the auto-vacuum daemon to vacuum/analyze them so if you aren't doing that manually there will be a different kind of problem (bad stats) preventing the query from being executed efficiently. But in terms of the "barrier", no, they are no different than any other table added to a query FROM list.
David J.