That said, it should be made clear that Buddhist precepts aren't equivalent to commandments in that they're training rules which are voluntarily undertaken rather than edicts or commands dictated by a higher power and/or authority. The precepts are undertaken to protect ourselves, as well as others, from the results of unwholesome actions.
As for whether having a glass of wine with dinner or something like that violates the fifth precept, it depends on who you ask. Some say yes and some say no. Dhammanando Bhikkhu, for example, states:
In the Theravadin understanding the fifth precept enjoins complete abstinence, not moderation. It is broken when one knowingly consumes even the smallest amount of alcohol. It is not broken if the alcohol is consumed unwittingly or is an ingredient in an essential medicine.
The main reasoning behind this interpretation — which is based on Abhidhammic teachings — is that "every breach of the fifth precept arises from a greed-rooted citta."
Ajahn Khemasanto, on the other hand, has said that having a glass of wine with dinner (for a lay-followers at least) doesn't violate the fifth precept as long as one stops before they can "feel [the effects of] the alcohol." The main reasoning behind this interpretation, I suppose, is the intent of the precept itself — i.e., to help protect one from breaking the other four precepts, not to insinuate that drinking alcohol in and of itself is unwholesome — which I think is supported by this passage from Sn 2.14:
A layman who has chosen to practice this Dhamma should not indulge in the drinking of intoxicants. He should not drink them nor encourage others to do so; realizing that it leads to madness. Through intoxication foolish people perform evil deeds and cause other heedless people to do likewise. He should avoid intoxication, this occasion for demerit, which stupefies the mind, and is the pleasure of foolish people.
This point is echoed by the Ven. Huifeng (Pannasikhara), who notes:
Whatever the case, there is still a problem with either of these approaches when it comes to the fifth precept, because most Buddhist schools take the stance that drinking alcohol is not a nonvirtue itself, unlike the first four precepts which necessarily have at least some amount of unwholesome mental state behind them. In the northern traditions, this precept is called a "precept of avoidance" (something like that!), and the others "precepts by nature".
Whether this is what the Buddha himself meant when he formulated the fifth precept, I can't say for sure; I'm just passing along what I've heard/read. I have a glass of beer or wine once in a while myself, and I don't lose any sleep over it. Suffice it to say that I tend to follow the spirit rather than the letter when it comes to doctrine. One drink doesn't make me careless, and I don't beat myself up if I decide to have a pint with my mates or my girlfriend. I just note that I gave into this particular sense-pleasure and carry on with my practice. No excuses, but no guilt, either.
Of course, many people will take issue with this, suggesting that to openly break a precept you've undertaken amounts to hypocrisy or even spiritual laziness, and I think there's some truth to that. But looking at it another way, I think taking the precepts knowing that I'm probably going to break one on occasion is better than not taking them at all.
I may not be a very good 'Buddhist' in the eyes of some because I occasional have a glass of wine or a pint of beer, but hey, at least I'm not lying about it. After all, Buddhism isn't called a gradual path for nothing (MN 107). Some of us are just harder to train than others.