Whatever is local. Shipping (literaly, use ships for transport) is wildly expensive in medieval times so only the rich merchants will be able to use exotic materials. And use "exotic" in a wide sense here, ideally everything the city is built out of comes from within a day of slow sailing. Most of the city will be built of wood, as that is relatively cheap and versatile. Pine in scandinavia, oak is preferred further south but is relatively expensive, beech or ash are also usable.
Foundations and lower walls will be built out of any local stone. The richer the inhabitants the more stone will be used. Sandstone is possible but it'll be in a sandstone area. If you are in a river delta it gets a bit easier: you can ship in stone from higher inland and fire bricks from the local clay.
As for "dealing with salt and erosion": you don't. Hope to build up high enough and offer some votive offerings to your deity of choice. Occasionally the lower classes will drown but that's life (and death) in that era. If you look at the history of many medieval cities there will be many stories about "and then the harbor silted up and the city stopped being a local hub" or "and then (neighboring city)'s harbor silted up and traders from there flocked to this city because it had a good harbor"
If you are building a city it'll be on good anchorage (see Cadiz) or in a river mouth (see Kampen) and they often command strategic locations near straits like Messina.