The sentence
(1) Why didn't the postman come today?
is much more common, particularly in informal speech, than either of the other suggested forms.
The form:
(2) Why the postman did not come today?
is incorrect. "The postman" is the is the object of the sentence, and in a question, the object is normally placed before the verb (here "come") but after the auxiliary (here "did") This leaves the full form as:
(3) Why did the postman not come today?
But in speech or informal writing, sentences like (3) are usually contracted to forms like (1).
So "Why was the trash not picked up today?" becomes "Why wasn't the trash picked up today?" while a form such as "Why the trash was not picked up today?" is simply wrong, although it would usually be understood.
In fact, a form like (2) sounds like an incomplete sentence, perhaps part of something like:
It is a holiday. That is why the trash was not picked up today.