For all the laughter and merriment that attended last week's dinner and roast for outgoing City Administrator Elijah B. Rogers, Mayor Marion Barry and other top city officials betrayed more than a trace of uneasiness and tension.

The $35-a-plate dinner for Rogers at the Shoreham Hotel drew about 1,400 people, including the elite of Barry's administration and a cross section of Washington's civic and business establishment. Much of the evening was spent joking about Rogers' bald head, his 5-foot-1 stature and his cockiness.

"He is never shy about his talent or the monetary value of his talent," noted Virginia Fleming, a public policy official and Rogers's former executive assistant. William Rumsey, former director of the Department of Recreation, added: "He brings a new dimension to stinginess. Talk about short arms and deep pockets. . . . He spends nothing but time."

But the air of gaiety wore thin as the events of the long evening droned toward midnight, nearly two hours behind schedule, and the mayor approached the podium for the second time.

Barry, who along with Rogers and Deputy Mayor Ivanhoe Donaldson had just gone through a rough week of defending their intervention in a D.C. Lottery Board controversy, cast a pall on the evening with a humorless and rambling roast of his city administrator that left the audience embarrassingly silent.

Barry groused repeatedly that Rogers had received far better treatment than he did in the press.

"I'm restrained because I don't want to bust The Washington Post's bubble about Elijah Rogers," said Barry, who added sourly that, in the eyes of the press, Rogers "brought professionalism to the city; the mayor brought politics."

In trying to explain the mayor's performance, several officials noted it had been a long day for Barry, an even longer program than expected and said Barry had had several drinks in addition to medication for an eye infection.

The undercurrent in Barry's remarks also may have reflected anxiety over the major shift in power taking place in his second adminstration.

Rogers, the self-assured, harshly demanding black public administrator who ran the city's bureaucracy for the past 4 1/2 years, is being replaced by a protege of sorts, Thomas M. Downs, a white career public administrator whose mettle as an infighter has yet to be truly tested.

Donaldson, deputy mayor for economic development and Barry's most influential political adviser, has said he is fed up with criticism he has received and plans to leave government before the end of the year.

Many of the administration's top players, while accomplished specialists in their own right, are still feeling their way in their new, more visible roles, including Alphonse G. Hill, the former controller and now deputy mayor for finance; Betsy Reveal, the new budget director; and Carol Thompson, director of a newly created regulatory and licensing superagency.

Annette Samuels, the mayor's press secretary, recalled Barry spent much of the day of Rogers's party in a quiet, subdued mood. "I really think it was the emotion of the thing," she said. "For him, it was quite difficult."

John A. Wilson, the outspoken council member from Ward 2, has been dropping hints lately that he just might not run for reelection next year. "I'm tired, tired, tired, tired," Wilson drawled during council debate last week on the city's elections mess.

But skeptical Wilson watchers can recall other times he has announced hopeless frustration with the council, including the time a couple of years ago when he angrily disappeared for several days.

One clue may be an an eight-page tabloid that began hitting Ward 2 mailboxes over the weekend.

A smiling Wilson, in shirtsleeves with his coat thrown over his shoulder campaign-syle, is pictured on the front of the tabloid. Inside, there are 13 other pictures of him amid glowing stories on tax issues, public safety and community development.