Carport pipe support rusted out

This is a shed (previously posted about as in need of extensive renovation), with a half-assed carport in front, built by a previous owner. It's a fairly amateurish job and we only keep it around because it is useful to keep things out of the rain.
The sides are supported by two pipes, about 4-5" dia., some 8' apart. There is a fifth pipe support in the rear center; the front support was replaced with a 4x4, I think when we purchased the property. Now that it's become my responsibility, I've been cleaning up things and the accessible pipes have already gotten the wire brush and naval jelly treatment for what isn't really an astounding amount of surface rust. I've worried about what might be the case below ground, though -- the pipes just come right out of the dirt, and whatever protectant they had when installed has long since ceased to do the job.
Anyway, having excavated about 10-15 years worth of accumulated crap, I got my first good look at the supports on this wall. The middle column (rear pipe of two) simply came loose in my hand! Down at ground level, where there's a drainage problem, the support is split at an angle, and from the "fit" of things seems to have lost as much as an inch to rust. Fortunately, the framing of the roof and wall, despite what you'd think from appearances, seems not to miss the physical support here.
Given that I don't want to do the whole-hog rebuild approach, just yet anyway (there's a non-zero chance the city may order us to raze when we try to get a building permit). Would there be any value in "patching" this pipe with one that, say, just fits inside and gets bolted to the unrusted part of the support up above? I don't see why it wouldn't work and last at least as long as any of the other columns.
And how should pipes like that be built? Stuck right in the ground seems a little reckless, even if it did last a couple of decades. I imagine there are concrete footings, but is that otherwise normal? How would it be done today? *If* we get to keep the building, I'd like to do this right someday.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

If the 4x4 replacement suits you, look at Simpson Strong Tie for post anchors. That would but everything above ground level. TB
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.