The move gives the Pirates a veteran bat with a chance to provide the team with a short-term solution at a position it has struggled to fill since trading Josh Bell to the Washington Nationals in December 2020.
The 31-year-old Choi is a career .239 hitter in seven seasons, with 61 home runs and 225 RBIs in 486 games spread among four teams. Choi spent the last four-plus seasons with Tampa Bay. He hit .233 with 11 home runs and 52 RBIs in 113 games with the Rays in 2022.
First base has been a revolving door for the Pirates since Bell's departure. The players who made at least one start at first base for Pittsburgh in 2022 included Michael Chavis, Yoshi Tsutsugo, Josh VanMeter, Bligh Madris and Daniel Vogelbach.
Choi is in his third and final year of arbitration. He made $3.2 million last year for the Rays.
In a social media post, Choi said he was surprised by the trade, adding that he had hoped "to retire with the Rays uniform."
"I will miss every Ray fan's love and support they brought into the Tropicana field," he wrote on Instagram. "Without you, baseball is nothing, and I couldn't be here today."
Hartman, a fourth-round pick by the Pirates in 2020, had Tommy John surgery on his right arm in late 2020. He appeared in 22 games for Bradenton, Pittsburgh's Single-A affiliate, in 2022. Hartman went 0-1 with a 6.27 ERA with 16 walks and 19 strikeouts in 18⅔ innings of work.
The Pirates also made a flurry of roster moves following the trade. The Pirates reinstated OF Canaan Smith-Njigba, RHP Colin Holderman, RHP Yerry De Los Santos, RHP Blake Cederlind and RHP Max Kranick from the 60-day injured list.
Cederlind, RHP Peter Solomon, RHP Beau Sulser, C Jason Delay, LHP Eric Stout and C/1B Zack Collins have been removed from the 40-man roster, cleared waivers and outrighted to Triple-A. Stout and Collins have become free agents.
The Rays reinstated five players -- second baseman Brandon Lowe and pitchers Shane Baz, J.P. Feyereisen, Andrew Kittredge and Ryan Thompson -- from the 60-day injured list and added them to the 40-man roster.
Anderson, McKay, Yacabonis and Quinn all cleared waivers. The Rays outrighted McKay to Triple-A Durham, while Anderson and Quinn elected free agency. Yacabonis became a minor league free agent on Thursday.
Information from The Associated Press was used in this report.