Ditto - the fencing that capt caveman has a picture of doesn't stand up to animals trying to get out very well. If your dog just works at the same area for a little while, eventually one of those welds will pop loose. Once that happens, the rest of the fence pretty much just falls apart.
I'd recommend a woven wire, rather than welded wire. It can be put up and be slightly attractive.
Last I bought some, it was around $300 for 330 feet (it comes in rolls of 100 feet or 330 feet.)
4x4's, you can figure the price on fairly easily. Most of the posts don't have to be in that deep - just the last two at each corner. If you do the corners correctly, when you tension the fencing, it'll just stand up straight the entire length without "needing" the extra posts to support it, although, they're necessary. If the above will stop goats (some other breed of goats than what I raise - that's not my picture), then it'll certainly stop a dog.
Oh, and before you find out the hard way after doing all that work, a lot of dogs can learn to climb fences quite effectively. Our old dog used to be able to scale 6 and 8 foot chain link with no problem.