The CMS experiment will include a pixel detector for pattern recognition and vertexing. It will consist of three barrel layers and two endcaps on each side, providing three space-points up to a pseudoraditity of 2.1. Taking into account the expected limitations of its performance in the LHC environment an 8-9 layer pixel detector for an upgraded LHC is discussed.