NASHVILLE — Before last year's elections, the executive director of the Senate Republican Caucus obtained a copy of the entire database of handgun carry permit holders in the state. On Wednesday, the GOP-controlled chamber voted to block public access to those records.

The Senate voted 27-2 to pass the bill sponsored by Republican Sen. Ferrell Haile of Gallatin. Those voting in favor of the measure included Senate Speaker Ron Ramsey of Blountville, who had previously expressed support for keeping the records open to the public.

Ramsey wanted to find a way to bar media organizations from publishing the handgun carry records online, but a state attorney general's opinion found constitutional problems with that approach.

The House would have to agree to minor changes before the bill could head for the governor's consideration.