This paper derives the optimal pension and tax parameters in a society where individuals differ in two characteristics: rationality and productivity. Rational agents, if not liquidity constrained, smooth consumption over their life-cycle. Myopic agents, by contrast, have ex ante a strong preference for the present and undertake no savings, even though, ex post they regret their decision. Given a paternalistic social objective aiming at maximizing the sum over ex post utilities, this paper shows how both transfer systems interact in their degree of redistribution and generosity. Moreover, it reveals how the optimal policy parameters change if capital markets are imperfect, implying that agents cannot borrow against their retirement benefits. Analytical and numerical results show that in some cases only one transfer system prevails.