SAN FRANCISCO -- The Arizona Diamondbacks are costing themselves crucial late-season wins by missing scoring opportunities.
Two straight shutouts by the San Francisco Giants and Arizona dropped into a first-place tie with Colorado in the NL West.
Pinch-hitter Gorkys Hernandez singled home the winning run with one out in the ninth inning, lifting the Giants to a 1-0 win on Tuesday night.
"We've got a long way to go. We can't win it today and we can't win it tomorrow," manager Torey Lovullo said. "We've got to play good baseball for another 30-plus days. Our guys are battle-tested. They're smart, they're aggressive, they're tough, and I want them to remember that."
Steven Duggar scored the deciding run moments after what looked like a potentially serious injury. Duggar stayed in the game after making a headfirst slide back into second on Nick Hundley's single after he initially rounded second. Duggar was seen testing his bruised left shoulder, which will be re-evaluated Wednesday.
"I was out there, he was in pain," manager Bruce Bochy said. "He said, `I'm staying in this game."
Going back to Sunday's 5-2 win against Seattle, the Diamondbacks have gone 23 innings without scoring, shut out for the seventh time this season.
San Francisco earned its 12th shutout and extended its winning streak to four games.
"All we can do right now is just kind of put our head down and try to go win today," ace pitcher Madison Bumgarner said. "... We're not going to look behind, we're not going to look ahead. We're going stay focused on that day and then see where we're at at the end of it. It's no secret a lot of stuff has to go right and a lot of stuff has to go wrong."
Brad Ziegler (1-6) walked Duggar with one out, taking the loss for his first decision since returning to the Diamondbacks in a trade from Miami before the deadline.
Will Smith (2-2) pitched a 1-2-3 ninth for the win.
Diamondbacks reliever Archie Bradley allowed consecutive one-out walks in the eighth then manager Torey Lovullo turned to Andrew Chafin one out later and he retired Brandon Crawford on a groundout with runners on second and third.
Arizona failed to take advantage of a break in the seventh when Giants left fielder Austin Slater flubbed a lazy fly ball by Jon Jay then slid on his backside trying to retrieve the ball for a three-base error.
Bumgarner allowed four hits, five strikeouts and four walks. He has surrendered three or fewer runs in 13 of his 16 starts, but had nothing to show for this one. He was coming off eight strong innings in which he gave up one earned run to beat the Mets last Thursday.
Buchholz has allowed only one run over his last three starts and 23 innings.
San Francisco has played at least one one-run game in each of its last nine series.
Joe Panik thought he had a two-out double in the third when the play went to review and was overturned in just less than two minutes. He was thrown out at second by center fielder A.J. Pollock and credited with a single.
Diamondbacks: 1B coach Dave McKay was OK after he took a ball to the head during batting practice when it ricocheted about 75 feet off the protective L screen, according to Lovullo. ... Arizona recalled INF/OF Christian Walker from Triple-A Reno to add right-handed hitting depth on the bench and optioned RHP Matt Andriese to Class-A Visalia. Andriese, who also will work out at the team's Salt River Fields facility, will be stretched out to start and the D-backs didn't want to take innings from any potential September call-ups who need innings at Triple-A.
Giants: C Buster Posey is scheduled to return to the Bay Area on Thursday from Vail, Colorado, where he underwent season-ending right hip surgery Monday. Bochy exchanged texts with Posey and said "he's doing great" and is already up and moving around. ... RHP Jeff Samardzija is scheduled for a second opinion on his inflamed pitching shoulder Wednesday from Dr. Tim McAdams at Stanford.
Arizona 13-game winner righty Zack Godley (13-7, 4.59 ERA) is 5-0 with a 4.05 ERA over his last seven road starts and will be opposed in the series finale by standout Giants rookie Dereck Rodriguez (6-1, 2.30 ERA). The right-hander makes his second start since coming off the DL from a strained right hamstring.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Cardinals' Carlos Martinez shut down, to be re-evaluated March 5
Cardinals pitcher Carlos Martinez, who had an MRI this week that showed his right shoulder is structurally sound, will be shut down for two weeks and be re-evaluated March 5.
Machado deal accelerates Padres' path back to the postseason
A team spending to win? The third baseman's move to San Diego changes the prospect-packed Friars' timetable for a return to contention.
Why Manny Machado's record deal makes sense
By signing the biggest free-agent deal in sports history, both the player and the Padres knew exactly what they were doing.
Winners and losers from Machado's $300 million deal with Padres
As Manny Machado heads to San Diego on the largest contract ever given to a free agent, we break down what the deal means for the infielder, the Padres and a certain other available star.
Few players have more talent than Machado
Tim Kurkjian reflects on Manny Machado's amazing skill set and his on-field controversies as he joins the Padres on a $300 million contract.
Teixeira: Machado had no offers from big-market teams
Mark Teixeira says Manny Machado wanted to sign with a big-market team, but he had no offers on the table from a team like the Yankees.