Sen. Lindsey Graham didn’t have to go far to find ample inspiration for his bill aimed at keeping guns out of the hands of seriously mentally ill people.

That motivation came in the form of Alice Boland, a Walterboro woman with a history of psychiatric problems, who police say legally bought a gun and used it to try to shoot people on the sidewalk in front of Ashley Hall School on Rutledge Avenue right here in Charleston. She was unsuccessful.

Sen. Graham’s bill would prevent anyone who has been treated against his will at a psychiatric hospital, or has avoided prison time by claiming insanity, from buying a gun from a retailer.

It is a move that would address a major problem with the country’s existing background checks required for retail gun purchases. Surely most would agree that insane people should not own guns.

Sen. Graham’s bill, which has bipartisan support, is a step in the right direction of reasonable gun control. It’s difficult to imagine even the gun-rights lobby taking exception.

But Sen. Graham, thus far, has made it clear that the same background checks that regulate retail gun sales would not regulate the sale of guns at shows.

That is a pity. A shooting victim doesn’t bleed less if the gun came from a gun show.

The senator fears that such private sales would create a slippery slope toward the creation of a national registry of firearms. It is not enough for Sen. Graham that Congress has prohibited a national registry. He should reconsider.

But meanwhile, his bill is worthy fodder for the Senate Judicial Committee to study along with other appealing bills that would outlaw straw gun purchases and limit the capacity of gun magazines. Allowing someone to purchase a gun legally and then sell it to someone who is not legally permitted to buy a gun only delays the unacceptable conclusion.

And one need look no further than Sandy Hook Elementary School in Newtown, Conn., to know why it makes sense to limit the capacity of gun magazines. Some military-style, semi-automatic rifles, like the AR-15 used in the Newtown horror, are equipped with 30-round magazines. Some legal semi-automatic guns have magazines with 50 or even 100 rounds.

The National Rifle Association opposes such limits, but it has given some ground on more thorough background checks for gun purchases. Indeed, Sen. Graham said that he and the co-sponsors of the bill worked with mental health advocates and the NRA.

Americans do have a Second Amendment right to “keep and bear arms.”

But that doesn’t mean they can keep and bear any and all types of weapons.

It also doesn’t mean that reasonable restrictions against mentally unbalanced people legally buying guns — and for more effective background checks to minimize that possibility — would be unconstitutional.

Before disputing those practical points, reconsider the lingering spectacle of an unstable young woman brandishing a loaded gun in front of a Charleston school.