SAN FRANCISCO -- Freshly promoted Marwin Gonzalez's third-inning leadoff double to right field drew an audible groan from the 129th consecutive sellout at AT&T Park. No perfect game this Sunday. But Matt Cain and the Giants did treat their fans to a 3-2 win over the Houston Astros and a series sweep in their last home game until July 23.Starting pitching report:Matt Cain entered Sunday's game with a streak of 28 consecutive Astros retired, dating back to 2011 and including his June 13 perfect game. More of the same from the Giants' horse as he went 1-2-3 in the first and second innings to push his retired batters streak to 34 before Gonzalez's double. Cain had the chance to strand him, but it was his error that brought the Astros within one on the unearned run.Houston earned its next run. Brian Bogusevic knocked a fourth-inning single and Chris Johnson tattooed a ball into the left-center field gap. Bogusevic came all the way around to tie the game, but strong San Francisco defense limited the damage and kept it tied at two.Thanks to his offense, Cain took the mound again with the lead in the sixth inning, and he turned in a shutdown inning of dominant proportion. Facing the heart of the Astros order, he struck out All-Star Jose Altuve swinging on a tight slider, Scott Moore looking on the same slider and J.D. Martinez swinging at a 92-mph outside-paint fastball.Cain was lifted in the seventh inning after Gonzalez's ground ball eluded Brandon Crawford, who was moving to cover second with Bogusevic in motion.It wasn't perfection, but it was enough to leave in line for the win. Cain's final line: six and one-third innings, five hits, two runs, one earned run, one walk, six strikeouts, 108 pitches, 74 strikes and the win.Bullpen report:Jeremy Affeldt entered the game -- and a high-stress situation -- when Cain sputtered in the seventh. Protecting a one-run lead with one away and runners on the corners, Affeldt induced a foul pop out from Carlos Corporan and got pinch-hitter Jason Maxwell -- he of the big ninth-inning double Saturday -- to fly out to right field and end the threat.With the dynamic specialist duo of Javier Lopez and Sergio Romo warming up in the bullpen, Affeldt staying in for the eighth inning and made quick work of Jordan Schafer and Altuve before he hit Moore in the forearm.Bochy was quickly out of the dugout calling on Romo to face the right-handed Martinez. Romo's Frisbee-slider was on point, and Martinez went down swinging to end the inning.Still holding on to the one-run lead, Bochy elected not to start the ninth inning with Santiago Casilla. Instead, it was Javier Lopez who faced Bogusevic. As he had done to each of the two other batters he faced this series, Lopez struck him out.And then it was Casilla time.Fans were audible with their disfavor of Bochy's decision, but Casilla was strong. He struck out Johnson and got Gonzalez to ground out to record his 23rd save of the year -- good for third in the National League -- without a shred of doubt.With the bats:Owners of 23 hits in the first two games of the series, the Giants kept finding space between the lines early Sunday. Gregor Blanco and Emmanuel Burriss each slapped singles between short and third to begin San Francisco's day at the plate. After a wild pitch, Buster Posey stroked a clean single to right-center field to plate Blanco and open the scoring. After loading the bases with one out, though, the Giants could only add one more run when Brandon Belt drew a four-pitch walk that scored Burriss.Two runs for Matt Cain against the Astros? It wouldn't be enough on this Sunday.The Giants were primed to score when Norris walked the first two batters of the fourth inning, but Crawford, Cain and Burriss came up empty with runners in scoring position.Tied at two, Sandoval put the pressure on the Astros with a leadoff double in the fifth inning. The Giants didn't waste any time, as Posey's second RBI single of the game reclaimed the lead.Posey added a seventh-inning single to finish the game 3-for-4 with two RBIs.With the gloves:Matt Cain did well to field Norris' third-inning sacrifice bunt and throw across his body and against his momentum to record the out. But he was tested again when, with two outs and a runner on third, Schafer dropped down a second consecutive bunt. Cain charged this one towards the first-base line, but his on-the-run overhand toss to first dove towards Brandon Belt's feet and couldn't be corralled. Cain's error allowed Gonzalez to score and brought the Astros within one.On the next play, Crawford dove to his right to field Altuve's sharp shot in the hole, rose and fired a one-hop frozen rope to Belt that appeared to beat Altuve by a hair. First-base umpire Lance Barrett saw otherwise and the inning continued...for one more batter.Crawford made another nice play in the fourth inning when, while leaning toward second to keep baserunner Chris Johnson close, Gonzalez hit a ground ball his way. Crawford charged, scooped it up and made the alert play to throw on to Sandoval with plenty of time to cut down Johnson, who made the ill-advised decision to take third on a ball hit a step in front of him.The fine fourth-inning defense wasn't over. Crawford's fielder's choice left Gonzalez on first base, and when he attempted to steal, Crawford slapped down the tag from a rifle throw by Buster Posey and trotted off the field.Attendance:The Giants announced a paid crowd of 42,265, 25,000 of which went home with the coveted Madison Bumgarner bobblehead, complete with the 22-year old's bristly 5 p.m. shadow. Up next:After a travel day Monday, the Giants hit the road for a six-game trip through Atlanta and Philadelphia that begins with Barry Zito (7-6, 4.01) and Jair Jurrjens (3-2, 4.97) going head to head at 4:10 p.m. Coverage begins Tuesday at 3:30 p.m. on Comcast SportsNet Bay Area.