I had started an answer with "Dear [username] " and I see that this heading was deleted by a moderator. Is this a general policy on this site ? I'm a new user and don't yet know the rules. Needless to say, I am not arguing and intend to comply but I just wanted to ask about this point of etiquette.
The key thing to remember is that this site is not a traditional forum or a social network; it is all about questions and answers, not "addressing fellow users". When you write an answer, you don't write it just for the original poster, you write it for anyone and everyone who might have that question in the future. Personal salutations are extraneous clutter at best, and completely misleading at worst. Remember that anyone can change their user name at any time without notice, or even completely delete their account, so you will end up addressing a meaningless string of characters.
For further reading, check out e.g. this question on the meta Meta: Should 'Hi', 'thanks' and taglines and salutations be removed from posts?
Here I will quote just a paragraph or two.
If this is supposed to be a website which is servicing more than just the primary author, we need to think about how we construct messages so that they appear more clearly to those searching on google for questions that match their own. If I am looking for a solution for question X, I want to find someone who had the same problem, not their short autobiography and formalities before getting to that actual question. — TheTXI
[I]f we had two parallel worlds, one with the [post] including the greetings etc, and one without, which would we choose? I'd choose the world where the [posts] just had the required information, as readably and concisely as possible. — Jon Skeet
Usually we restrict the question area to the question itself, since the site is intentionally structured as Q&A rather than forum discussion. So introductions, thank-yous, signatures, and the like are generally deleted. (Of course, these aren't seen as "poor etiquette" per se, they are just not part of the format of the site, so they will be removed when not relevant to the question.) The same goes for answers.
Greetings are polite, and generally used on forums.
However, Stack Exchange sites are not forums, and greetings take up a line of space for no particular practical reason.
Thus, per convention, the greeting is made implicit. There is no need for it on every single post... or, indeed, on any!