SAN DIEGO -- Andrew Cashner pitched brilliantly into the ninth inning and the San Diego Padres beat San Francisco 3-2 Saturday night to keep the Giants from gaining ground on the NL West-leading Los Angeles Dodgers.