We used two ways to secure the deck posts on top of the concrete piers. The first ways is illustrated in this picture.
Basically a hole is drilled in the bottom of the post, into which the anchor bolt sticking out of the goes into. The trick is making sure the hole is deep enough, or shall I say high enough for the pin (that's the bolt) to completely fit into.
When raised and siting on the "pin" the post just isn't going to move.
So what is the black stuff on top of the concrete pier?
There is building code requirement, and just smart practice, to isolate the dampness of concrete from any wood. We did a similar isolation between the concrete footing and/or wall from the wood walls by using something called a sill gasket. Here, it is generally accepted that a piece of tar paper is used to isolate. We used an asphalt shingle - cut to fit.