If you cannot find wooden porch rail parts long enough in your local home center, you can use stair rail parts. The handrail comes in lengths up to 16 feet, in oak or hemlock.
![handrail](https://i.stack.imgur.com/qoBAT.jpg)
You would also need shoerail.
![shoerail](https://i.stack.imgur.com/PTM8s.jpg)
The center section of each comes out to leave a channel to hold the balusters.
![baluster](https://i.stack.imgur.com/32h2u.jpg)
All of these are unfinished, but you may be able to find primed versions.
Assuming you are lifting the shoerail above the porch floor (the most common style), you need to support the shoe rail in several places along the 9 foot run. The balusters will then support the middle of the rail.
You might also consider putting a newel post in the middle of the rail run to break it up and increase the lateral stability (toward and away from the house).
![newel](https://i.stack.imgur.com/O9P26.jpg)
Fancier ones are also available.
All of these parts are unfinished and not pressure treated. They do need careful priming and painting (including the cut ends) preferably prior to assembly. They also need regular maintenance, but would give a great look.
You may be able to find similar materials in pressure treated lumber or cedar, both of which are more rot and weather resistant with more limited maintenance (but they do need some). However the longer runs may be harder to find.
If you are putting in a middle newel post, you also could use some of the prefab rail sections, either wood or metal since each section would be slightly less than 4.5 feet.
You call it a patio, so I assume it is not a wood deck (which would be easier to add a railing). I'd avoid attaching it to the house though it seems that the other end of the patio roof may be tied to the house already.
Consider driving a super spike into the ground at each end to hold a post that will be the ends of the railing. At a 10 foot span, you'll want one in the center of those two as well. If driving the spike just off the patio won't work, then remove a patio stone and drive the spike where you need it. You can break/ cut the patio stone to fit around the post once its in place.
Best Answer
You always want railings to be very strong. Folks seem to have a natural trust of railing, and you don't want to break that trust. When somebody leans against your railing, you don't want the railing to give way and allow the person to fall.
Depending on the design of the railing, you'll want to use bolts and/or screws wherever possible. Nails will pull out far more easily than either screws or bolts.