Pittsburgh Mayor Peter F. Flaherty's decision early last year to support a struggling Jimmy carter in the Democratic presidential primary was greeted by political clucking.

Now, President Carter's announced intention to appoint Flaherty to the second-ranking position in the Justice Department has engendered a similar reaction - albeit one that is not seen as harmful to the mayor's chances for confirmation.

Flaherty, 52, is in line to become the next deputy attorney general. If he is confirmed, as expected, he would become the 35th person to hold that post since it was created in May, 1950.

The deputy attorney general's job can be powerful - which bothers those who claim Flaherty has no legal background for the post and who view his expected appointment as an act of "pure politics."

By law, the deputy attorney general is empowered to perform all the duties of the attorney general if circumstances - a vacancy in the top office, disability or temporary absence - require it.

The deputy also assists the Attorney General in making policy, coordinates the activities of the department's divisions: recommends to the Attorney General appointments to federal judicial positions; and oversees the hiring, firing, and the general administration of the department's legal force.

Former Attorney General Richard G. Kleindienst, who served as deputy from 1969 to June, 1972, says, "For all pracatcal purposes, the job of the deputy attorney general is what the two people - the Attorney General and his deputy - make of it."

Though Attorney General Griffin B. Bell has yet to say exactly what Flaherty would do in the deputy's job, he has mentioned te possibility of putting all of the department's criminal functions including the FBI under Flaherty, and assigning all civil functions to an associate attorney general.

Some Pennsylvania politicians said they were surprised President Carter would tap Flaherty for the job.

"I've known Pete many years," said a Republican attorney who calls himself a Flaherty friend.

"He's a thoroughly charming guy, a good mayor and an abominable choice for the deputy's post," the attorney said. He and some Democrats charged that Flaherty lacks legal experience.

Flaherty earned a law degree from Notre Dame in 1951 and entered private law practice with the Pittsburgh firm of Brandon and Shearer.

In May, 1955, he ran as a Republican for a local school board seat and lost. In 1957, he applied for a job as an assistant district attorney for Allegheny County - a part-time post. He got that job, held it for eight years, and emerged as a Democrat.

Although his critics say Flaherty lacked something as a prosecutor, there are those, Attorney General Bell among them, who say he did a creditable job as prosecutor. Bell said Flaherty "prosecuted hundreds of cases . . . and has a broad background in criminal justice matters."

As a mayor, Flaherty, now in his second term, has earned a solid reputation as an administrator who managed to keep the lid on property taxes and to finish each fiscal year with a budget surplus at a time when other cities, like New York, were going bankrupt.

Flaherty is credited with eliminating patronage from his city hall, cutting the payroll and generally "cleaning up" Pittsburgh's government since he took office in 1970.

Sen. H. John Heinz III, one of Pennsylvania's two Republican senators, says he will push for Flaherty's confirmation.

"Mayor flaherty is quite popular in our area," said Heinz, a fellow Pittsburgher. "I wold have to say that Mayor Flaherty does not have an impressive legal background. I think he would be the first to admit that. But on the other hand, he has run a scandal-free administration, a very tight ship."

Heinz said he would support Flaherty as long as the mayor promises not to use his new position as a springboard to higher elective office. Heinz says his stipulation is a matter of principle. But other politicians in Pennsylvania say it is based on a fear that Flaherty would run in 1978 for the Pennsylvania governor's office, an post reportedly desired by several Heinz friends.

Richard S. Schweiker, the state's othr senator, praised what he called Flaherty's "good, clear record of anti-corruption."

But flaherty's detractors accuse him of being unnecessarily abrasive toward some of the city's big business executives and of capriciously and arbitrarily dismissing workers in his patronage purge.

"For example, when he was going about 'cleaning up' city hall, he fire all of the cleaning women becuase he said they were not working full eight-hour days," said the lawyer, who is a Democrat. "These were not political hacks from the wards. These were just ordinary, working people. Most of them were white, from the Southside of Pittsburgh."

But if Flaherty angered some of the city's working class with his firings, he pleased some of them with his stand on school busing.

Flaherty traditionally has been in favor of neighborhood schools. In 1971, when the local school board was working on desegregation plans, he went to school board meetings to speak against busing.