On extensions of polynomial functions