The Diamondbacks traded Paul Goldschmidt to the St. Louis Cardinals. (David Zalubowski/Associated Press)

After a third straight year without a playoff appearance, the St. Louis Cardinals have made one of the offseason’s biggest trades to keep pace in the National League.

St. Louis acquired slugging first baseman Paul Goldschmidt from the Arizona Diamondbacks for catcher Carson Kelly, right-handed pitcher Luke Weaver, infielder Andrew Young and a 2019 Competitive Balance Round B draft choice.

Goldschmidt is a six-time all-star who spent the first eight years of his career in Arizona. In 2018, he batted .290 with a .922 OPS, plus 33 home runs, 83 RBI and 90 walks. He won a Gold Glove at first base in 2013, 2015 and 2018.

The Cardinals have struggled to find consistent offensive production out of first basemen since parting ways with Albert Pujols in 2012. Matt Carpenter moved over from third base, where he was a two-time all-star, to first in 2017, but his performance at the plate suffered, dropping 30 points the first season.

Adding Goldschmidt, 31, allows Manager Mike Shildt, who replaced Mike Matheny midseason, to move Carpenter back to third base, or even to second, where he started his big league career.

It also injects more power into a Cardinal lineup that was 10th in the majors in runs in 2018 and 11th in home runs.

None of the players that St. Louis traded has garnered much major league playing time. Kelly and Weaver have each spent parts of three seasons in the big leagues. Baseball America ranks Kelly as the Cardinals’ third-best prospect. Young is a second-year minor leaguer.

Goldschmidt is set to make $14.5 million in 2019, the final year of a five-year, $32 million deal. The D-Backs finished a distant fourth in the NL West and risked losing him to free agency next season with nothing in return.

They’ve also been reportedly shopping perennial Cy Young Award candidate Zach Greinke, who could command a much heftier price on the trade market. The right-hander with a career 3.39 earned run average is under contract for $32 million a year for the next three seasons.

Read more from The Post:

In signing Patrick Corbin, the Nats are winning the offseason without Bryce Harper

Dodgers entering Bryce Harper sweepstakes tilts his market to the west

The Mets’ trade for Robinson Cano is full of risk and intrigue