Parametric excitation of a rigid planar pendulum caused by a square-wave modulation of its length is investigated both analytically and with the help of computer simulations. The threshold and other characteristics of parametric resonance are found and discussed in detail. The role of non-linear properties of the pendulum in restricting the resonant swinging is emphasized. The boundaries of parametric instability are determined as functions of the modulation depth and the quality factor. Stationary oscillations at these boundaries and at the threshold conditions are investigated. The feedback providing active optimal control of pumping and damping is analyzed. Phase locking between the drive and the pendulum at large amplitudes and the phenomenon of parametric autoresonance are discussed.