Roger Gaffney

Roger Gaffney is a fictional police officer of the Baltimore Police Department on "". He was played by Walt MacPherson.
In Seasons 1 and 2 of the show, MacPherson made several cameo appearances as a uniformed police officer, the first in Season 1 when he finds an earring at a crime scene and offers it to Bayliss as possible evidence. The character wears a nametag that is not in focus enough to be readable, but seems to bear a name longer than "Gaffney." His good working relationship with the detectives and the unlikelihood of a policeman rising from uniformed patrol to captain rank in less than four years indicates that the uniformed policeman is not intended to be the same character as Gaffney. 
MacPherson is recast as homicide detective Roger Gaffney in "Nearer My God to Thee", the opener of the show's third season, as one of the night shift detectives working under Lt. Megan Russert. Introduced as a rude, bigoted, incompetent bully who is universally disliked in the squadroom, he becomes the primary detective on the first of three murders for which both shifts are called in. In this episode, he provokes a fight with Pembleton (whom he provocatively refers to as "Boy" and "Sambo") after the fastidious Pembleton, who has to share a desk with him, complains about his failure to clean up after himself. The two nearly come to blows, only to be restrained by their fellow detectives and sharply upbraided by Russert. 
When Russert learns of Gaffney's failure to investigate a potentially important lead, she reassigns the murder to Pembleton; Gaffney's subsequent insulting remarks lead her to transfer him out of Homicide. The character is rarely seen again for the rest of the season, but his limited screen time does establish that he holds a grudge against the Homicide unit in general, and against Russert in particular. By the time of the Season 3 episode "Nothing Personal," Gaffney has ended up in Missing Persons.
Meanwhile, Russert is promoted to captain for political reasons, infuriating the much more experienced Lt. Al Giardello ("The Old and the Dead"). In Season 4, following a confrontation with Colonel George Barnfather over her mishandling of the apprehension of a sniper, who commits suicide, Russert is demoted three ranks to Detective ("Sniper: Part 1"), leaving the position once again open. In the subsequent Season 4 episode, "The Hat", Gaffney is suddenly shown both as a lieutenant and as commander of his old evening Homicide shift, Russert's previous job. By the end of the episode, he has been promoted to captain, once again over Giardello. His promotion surprises the unit, and upon his appointment, he issues thunderous orders about how Homicide was going to be run by the book under his command, citing among other things various small infractions of department rules that Giardello had chosen to overlook.
Gaffney's meteoric (and highly implausible) rise from a bad-tempered detective in a dead-end department to captain of the Homicide Unit is explained somewhat in the Season 5 episode "Blood Wedding", in which it is revealed that Gaffney was chosen for promotion to captain over Lieutenant Giardello by Deputy Commissioner James C. Harris, for two overlapping reasons. First, Gaffney was loyal to the chain of command throughout the department, and was willing to follow orders from above unquestioningly if it meant he could indulge his natural tendencies as a bully. The second reason was specifically to punish Giardello, who was often shown leaking political departmental decisions that he morally disagreed with to the media. Not only was Giardello clearly a much more experienced candidate, the promotion was something that he wanted. Harris chose Gaffney in particular to rub salt in the wound because he was a "fat Irish ass" similar to Giardello's first partner, a racist officer named Mickey Shea who had made Giardello ride in the back of the patrol car. 
Gaffney is subsequently shown fulfilling his role as Harris' lapdog commander, often showing little to no moral objection to interfering with the Homicide Unit's investigations if ordered to do so for political reasons. This is best seen in the Season 5 episode "Narcissus", in which Gaffney barges into an interrogation of a member of the African Revival Movement and insists on speaking to the suspect privately. As soon as he leaves, the suspects invokes counsel indicating that he was coached by Gaffney. It is later revealed that the leader of the ARM, Burundi Robinson, is a former police officer who was Harris' partner, and that Harris wants him killed because his information about Harris' illegal activities would end his career. Giardello learns this information from Robinson before he can be killed, puts it in a letter to the mayor, and forces Harris's resignation. Though Gaffney, deprived of his benefactor, tries to lecture Giardello for ending Harris's career, he is shown to be much more cautious of tangling with Giardello after this incident. 
During this period, Gaffney also routinely (and anonymously) stole other people's lunches from the Homicide unit's breakroom fridge, until he was revealed to be the "Lunch Bandit" by J.H. Brodie, who caught him on tape in "The Documentary". 
Gaffney appeared sporadically throughout the remainder of the series working under Colonel George Barnfather. In Seasons 6 and 7, he assumes a largely subsidiary role as unit commander and is no longer directly antagonistic toward Giardello. In Season 7, he attempts to bait Gee's son, FBI agent Mike Giardello, into turning against his father. Gaffney was later shown to be upset over his son's discovery of Homicide detective Tim Bayliss's website. Gaffney came to Giardello requesting that Bayliss shut down the website which promoted bisexuality and Buddhism amongst other things or be subject to disciplinary action. This marked his last major appearance as an antagonist in the series.
The Movie.
After Gee was shot, Gaffney takes the side of a hotheaded younger detective over that of Pembleton and Bayliss when the long-inactive and retired detectives stop the younger detective from abusing a witness during a pointless interrogation. Gaffney outright says that he can do what he wants because power is arbitrary. Pembleton and Bayliss later ignore Gaffney. The new unit Lieutenant Stuart Gharty (another less qualified commander who could have been promoted in accordance with the "fat Irish ass" theory, although he is much less obnoxious than Gaffney and was eventually written as a competent detective), who worked alongside Pembleton, dislikes him but respects his work. Since Gharty also despises Gaffney, he looks the other way as Pembleton and Bayliss work around him and solve the shooting (eventually murder) of Gee.