Depending on how long you want it to last, you could put a wooden stick down in the hole that is snug to the inside of the pipe and gets fatter so it won't slide all the way down. Then attach the trellis to it.
If you have a smaller pipe that you could fit inside there, wrap it with electrical tape until it fits more snugly to avoid wiggling. Then drill a hole through it and stick a pin or bolt through to act as an upper stop. So as the small pipe slides down into the bigger pipe, the bolt/pin keeps it from dropping lower than you want.
Or with a bigger pipe for the extension, just wrap the existing pipe with tape until the diameter is closer to the big pipe to prevent wiggling and movement.
I'm sure there are 17 other ways to do this as well