This post is a bit of a plug but mostly a plea to would be electrical DIYers not to take chances. If you have a mind to make some sort of lamp using iron pipe then you must be aware that the pipe itself becomes a potential hazard - iron pipe - conductive. Make a little mistake in your wiring and the pipe will become live. You're smart, you know what that means. Peoples hair only smokes in cartoons, in real life... well, it ain't real anymore.
The scariest, and most commonly seen failure people make is not protecting the cable where it comes out of the lamp fitting and goes into the pipe. Because there is no (till now, see later) good way to make the mechanical transition between the little (usually 1/4") thread used on most fittings and the bigger threads used on iron pipe, it's common to see the joint fudged with electrical tape or whittled wood or large amounts of glue. These are not good enough. Over time any of these can wear and move and potentially allow the cable to rub against the edges of the pipe, ultimately resulting in the cable fraying and the inner wires touching the pipe.
So, what to do? This was my favorite solution for a long time:
Take a pipe plug of the same gauge as you need to match. Grind off the top and drill a 1/4" hole through the middle (the inside of the plug is usually hollow so it's pretty easy). Now thread a 1/4" lamp thread nipple and secure with a nut. A standard lamp fitting will screw right on making a very strong and secure joint. And the cable runs up through the pipe and and into the lamp fitting avoiding any risk of the cable being damaged.
But I got annoyed with having to all this grinding and drilling so I came up with this:
It's a precision machined, solid brass adaptor and it solves all those lamp fittings issues. It can be used in two ways, depending which way round you screw the lamp fitting to it. In one way the neck of the fitting protrudes and in the other it is recessed into the adaptor making for a cleaner, flush joint.
Want one? https://blackfriarsironworks.com/lighting-adaptor/