Gonzalez was the Pirates' seventh-round Draft pick in 2008 out of the Puerto Rico Baseball Academy.
The Pirates will receive a player to be named later or cash considerations.
Gonzalez, who can play shortstop, second base and third base and the outfield in a pinch, hadn't played in a game this season but instead was working out at the Pirates' Spring Training facility.
Gonzalez is a switch-hitter who spent the past three seasons with the Pirates' Florida State League team in Bradenton. He's a career .240 hitter with a .315 on-base percentage. In 2013, he had a career-high 27 steals.
The Padres felt they were a little short in terms of infield depth at Lake Elsinore coming out of Spring Training and have been looking for upgrades since then.
Corey Brock is a reporter for MLB.com. Keep track of @FollowThePadres on Twitter. This story was not subject to the approval of Major League Baseball or its clubs.