I think that you can guarantee that the domestic cold water water pipe is in contact with the ground.... unless you are supplied via plastic pipes.
These days a lot of the water pipework is plastic and I don't think that you can guarantee that hot water pipes are connected to ground. All metal pipes should be connected to ground.
The previous poster is correct. First, one must make the assumption that all of the water lines in question are metal--normally copper or galvanized steel. (If not, none of the water lines can be used as an electrical ground.) Typically in this case, all of the cold water lines are connected through various fittings to each other, and to the water main which is normally buried underground to its connection to the water meter. The hot water lines, however, are connected together internal the the building structure but then pass through a hot water heater. This heater has insulating couplings or unions ('dielectric couplings') as part of its construction, in order to help prevent corrosion. These couplings break the electrical connection to the main, and so do not allow the hot water piping to connect electrically to earth ground.
Often, the main building ground--or 'bond' wire--is routed from the main electrical panel to a clamp around the supply water line as it enters the building to take advantage of this physical contact with the ground and use it as an electrical 'ground' as well.
I stand corrected--thanks. I am only familiar with US codes, and was addressing the OP's question from that perspective. I'll do more research or provide additional cautions in the future. I appreciate the info!
I know this is a little late... but wanted to add you should make sure it is a cold water pipe with running water. Not only do you have the pipe acting as a conductor, you also have the water acting as a conductor. And with running water in the pipe you can be reasonably sure it goes to ground.
Many, many moons ago there was a computer room / data center on the upper floors of a building that was experiencing intermittent system crashes. To make a long story short, it turned out the ground / ground grid was connected to a cold water pipe that exited the building on the same floor, and ran half way down the building towards the ground. Once in a while a taxi would stop below the pipe and pick up a passenger. The cabbie would radio dispatch with his new destination... the cold water pipe running half way down the building would act as an antenna... and something would crash. A tech that had been dispatched to find the problem was fortunate to be looking out of a window when the passenger was picked up. Even when you are good, sometimes you need to be lucky.
The phrase 'with running water' was added to the installation procedures.