TELEVISION viewers in South Africa have become used to advertisements asking them to be frugal with electricity during the peak evening hours. In one commercial a swimming-pool pump in human form is kicked out of a house party: “pool pump not wanted” is the tagline. In another, a water heater is given the cold shoulder.

The campaign is on behalf of the Electricity Supply Commission, universally known as Eskom, the state-owned firm that produces 95% of South Africa’s electricity. It is unusual in that it does not appeal to thrift or greenery as reasons to conserve energy. Its main message is blunter. It says that the sparing use of appliances is needed to keep the lights from going out. The margin between electricity supply and peak demand has been perilously thin since 2008, when power cuts brought many mines to a standstill. So narrow has the gap now become that the chance of another spell of blackouts is worryingly high.

On November 19th Eskom was forced to ask its biggest industrial customers to cut their consumption by 10% at peak time. The curb was meant to last for ten days, so Eskom could be sure to avoid “load-shedding”, the polite term for scheduled power cuts for all users. It ended after only two days; Eskom said its spare capacity was much improved. But bitter complaints from industry about lost production owing to the curbs on electricity may also have influenced the decision.

Though short-lived, the latest emergency is a reminder of how perilously unreliable South Africa’s power supply has become. Eskom has to patch up so many of its ageing power stations that it has taken more out of service than might normally be considered prudent, even during the quieter summer months. The risk was that any problems with the plants that remained in service would trigger a temporary shortage. So it proved.

The deeper causes of today’s shortfall originated a decade or so ago. Ample power capacity that was built up in the 1970s and 1980s bred complacency. Eskom was forbidden from building power stations for several years to make room for potential rivals. That was a creditable policy but it went awry. The government took its time to set out terms for would-be energy firms. When they appeared, private capital lost interest.

The delay was costly. It takes around seven years to build a power station. By the time the ban on investment by Eskom was lifted in 2004, a crisis was looming. A new coal-fired power station in Limpopo province, in the north, will eventually add 10% to capacity but it has been delayed by strikes and tardy contractors. Meanwhile the existing plants are showing their age.

The wonder is that power supply has become stretched at a time when commerce is so listless. Figures published on November 26th showed that GDP grew between June and September at its slowest rate since 2009. It is strange that a country whose exports depend heavily on energy-intensive industries, such as carmaking and mining, has been so careless about power. Fitful electricity may now be as much a turn-off to much-needed investment by foreign companies as red tape and strikes. But then South Africa is a strange country. Few other places that also suffer from energy shortages are likely to have quite so many swimming pools.