PHILADELPHIA -- At Mick's Inn in the 25th Ward -- a tough working-class white neighborhood that once was a bedrock of the local Democratic Party -- the bartender asked each of the eight after-work drinkers whom they were planning to support in November's mayoral election.

"I don't vote for a black man," said a retired sales clerk who has rung doorbells for the Democratic Party for more than 40 years. It was one of the milder comments. All eight customers said they back Frank L. Rizzo, the Philadelphia politician who brought new meaning to the phrase "law and order" when he was a Democratic mayor from 1971 to 1979 and who now is seeking to regain the office as a Republican.

"You can't tell people in these river wards how to vote. They go in and pull white, white, white," said another customer, anticipating how the 25th Ward voters will cast their ballots in the upcoming election: for Rizzo and against W. Wilson Goode, the city's first black mayor.

The racial polarization that dominates the Goode-Rizzo contest is, however, just one key element of a far more significant change taking place in the strength and composition of Philadelphia's Republican and Democratic parties.

In this city, where traditional Democratic loyalty has already been severely eroded in white, working-class communities, the balance of power in the Democratic Party has just shifted to the black community.

As a result, although whites remain a majority in the city, they have become a minority in the party that controls City Hall and the city's delegations to the state legislature and to Congress.

Although Rizzo has only an outside chance of winning back the mayor's office, he has become the driving force behind the new racial equation in the politics of this city.

"We are going to make Philadelphia a two-party system, and I'm going to be the first big city on the East Coast to go into the Republican column," Rizzo said.

Politicians here -- both Republican and Democrat -- question whether Rizzo will live up to his boast, but there is no doubt that the former mayor and police chief is the catalyst for an unprecedented surge in Republican registration among white voters, many of whom are leaving the Democratic Party.

This surge has given new vitality to the minority GOP. Rizzo's success in converting working- and lower-middle-class white Democrats to the GOP has moved blacks from a minority to a plurality in the Democratic Party for the first time in the city's history.

In less than two years -- from late 1985 to the close of registration on July 6 this year -- a 37,613 edge for white voters in the Democratic Party (406,865 white to 369,252 black) has been converted into a 14,823 margin for blacks (360,475 black to 345,652 white).

"Rizzo took out enough whites to tip the balance for the blacks," said James Tayoun, Democratic leader in the 1st Ward and a candidate for City Council.

Rizzo conducted the Republican registration drive to ensure his victory in the city's May primary. He has been continuing the effort to improve his chances in the November general election. In the process, the Democrats' 4.2-to-1 advantage in 1985 has dropped to a 3-to-1 majority in voter registration.

Goode, in an interview, played down the importance of the growth in Republican registration, contending that after the election most will return to the Democratic fold. "It will shake itself out," he said, and whites will regain a majority in the Democratic Party.

Goode said he believes that the composition of the Democratic Party should "reflect the racial composition of the city," which is roughly 57 percent white, 40 percent black, and 3 percent Hispanic, Asian and other groups.

In the meantime, however, for Tayoun, who is running for the council in a white district, the presence of Rizzo as a Republican at the top of the ballot, along with a growing list of Republican voters, has turned what would otherwise be a cakewalk general election campaign into a serious contest against Republican Constance McHugh.

"If we faced head on, I'd beat her 90 to 10. But she's got Rizzo," Tayoun said. Not only does McHugh have Rizzo, but Rizzo has helped create a new generation of Republicans in Tayoun's predominantly white ethnic district. In Tayoun's 1st Ward alone, the number of Republicans has grown by more than 1,000 -- from 3,217 at the end of 1985 to 4,259 last month -- while the number of Democrats has dropped by nearly 2,000, from 10,661 to 8,788.

The racial divisions in the Goode-Rizzo contest were apparent in the Democratic Party in the May primary, when Goode faced Ed Rendell, a white whose political views are far more liberal than Rizzo's.

Analysis of ward results and exit polls by The Philadelphia Inquirer and WCAU-TV showed the following:

Rendell, who had received 71 percent of the city's black vote when he ran unsuccessfully in the 1986 gubernatorial primary, received only 3 percent when he ran against Goode. Goode garnered 97 percent of the black vote; Rendell received 88 to 90 percent of the white vote.

For the first time, a higher percentage of blacks than whites turned out in the primary -- 56 percent of registered blacks voted, compared with 50 percent of the whites.

Blacks and whites hold almost opposite assessments of how the city has fared under Goode. In the WCAU exit poll, 76 percent of the blacks said the city has improved since Goode took office in 1983; 74 percent of the whites interviewed said the city has gotten worse.

The changing racial balance of power between the Republican and Democratic parties is provoking fears among some white Democrats that if the trend continues, the Democatic Party will be the "black party" and the Republican Party will be the "white party" in a city where whites hold a commanding majority among registered voters, leading 561,720 to 390,007.

"There is a very real danger that there is a shift taking place, a dichotomy between black and white that seems to be transcending partisan considerations," said James Lloyd, a former Democratic state senator who lost his district in 1984 by 1,000 votes, while President Reagan carried it by 21,000.

Growing Republican strength has already given the GOP a near lock on the local offices in the Northeast section of the city, and this political muscle has begun to extend down to what are known as the "River Wards" to the west of the Delaware River between the Betsy Ross and Benjamin Franklin bridges.

Although the Democratic Party had a 3-to-1 advantage in registration, Republican John Taylor, a former Teamster, won a state House seat in 1984 in a River Ward district from a two-term Democrat.

At first Taylor thought he was going to get no help having Reagan at the top of ticket because he said voters told him, " 'Maybe we'll give you a shot, kid, but Reagan's dead.' " But when the Democrats nominated Walter F. Mondale for president and Geraldine A. Ferraro for vice president in 1984, things changed.

"It was the perception that Mondale and the Democrats represented all the fringe wackos, the homosexuals, the save-the-whalers, the blacks, the Puerto Ricans and the Chinese. And, 'What about us, we're the regular guys.' Reagan, at least he's a John Wayne type, a meat and potatoes type guy and he doesn't seem to be interested in whether or not homosexuals have rights," Taylor said.

Two years later, Taylor held onto the seat, winning by 60 percent, even though the voters backed the Democratic gubernatorial candidate, Richard P. Casey, by equally large margins.

Both Taylor and Tayoun have similar assessments of what is taking place in the Democratic and Republican parties.

"There really are three parties right now," Tayoun said. "The white conservative ethnics, the blacks and the white liberals. Most of the races are turning out to be blacks against white ethnics." In the November race between Goode and Rizzo, Taylor said, "blacks will vote 95 percent black, whites will vote at least 75 to 80 percent white. It will be wealthy white liberals and turnout on each side that will determine the election."

During his 3 1/2 years in office, Goode has been plagued by a growing crisis in trash disposal because landfills have been closed. Plans to construct a massive trash burning plant were first delayed and now face political and legal challenges. When combined with the loss of 13,000 public service Comprehensive Employment and Training Act (CETA) jobs because of federal budget cuts, the result has been an end to regular weekly street sweeping, and periodically missed or postponed trash collections.

In a city that has traditionally respected powerful executives, Goode's difficulties in finding a solution to the trash problem have been as problematic to him politically as the destruction of a city block in May 1985 when police set a fire in trying to force a radical group called MOVE from a row house.

The mayor's stock, however, has been boosted by the dramatic economic revival of the city. Unemployment has fallen from nearly 12 percent four years ago to just under 6 percent, a level below the national average. A downtown building boom has produced $3 billion in capital investment, and 7 million square feet of office space is under construction.

Politicians interviewed here said they think that Rizzo will not be able to match Rendell's success in winning the votes of white Democrats because they disapproved of his highly confrontational and controversial tactics as mayor and police chief. But Rizzo said he believes that as a Republican running in an electorate with a strong white majority, he has "a clear shot at Wilson Goode, head to head."