I know you're probably headed off to pick up your gun already, but I'd like to interject one thing. Ignore everyone here who says .45>.40>9mm or 9mm>.45>.40 or .40>.32>.454Casul or whatever nonsense.
Fact. Pistols suck. It doesn't matter what caliber you choose. There is no benefit to .45 and no drawback to 9mm other than capacity and prices. And no person here can reference a valid study that proves anything different. The only credible studies done show that the caliber is completely irrelevant. You're going to have fire more than one round at the target to stop him. The average is around 3 rounds regardless of the caliber (actually it's about 2.5 but who fires 0.5 of a bullet?). The question is can you place 3 controlled rounds in a 9 inch circle from around 20 feet or less. If you can, all three of the favorite calibers will be acceptable. Some people using some guns can place 3 controlled rounds in that target regardless of the caliber. Some can't. Another fact, you'll shoot a .22LR pistol better than any larger pistol because you'll be able to control it better. But no one recommends that really unless you plan to pay for high quality rounds that you can bet your life on.
Since you're planning to get a 9mm, stick to 9 when you buy your second gun. It's always cheaper on you to stock pile a single caliber than to try to stock pile 5 different calibers and it also limits confusion under stress. Worst thing you can do is grab a box of 9mm to load into your newly purchased .45 by accident while someone is bashing in the door. Once you get comfortable and have a decent home defense set up, then branch out. Nothing wrong with any of the calibers, just get comfortable with what you have before you do.
Also, modern self defense ammo is SO well made and varied that it's pretty easy to pick up a 9mm round that tops .45 for energy. (which really doesn't do anything for mythical "stopping power" which doesn't exist.) For instance, a recent test of 230gr +p JHP ended up with a muzzle velocity of about 850 fps on a 5" barrel. That equates to around 369 ft lbs of energy. While Underwood ammo makes a 9mm that makes almost 1400 fps. That approaches 501 ft lbs of energy. So there's more to it than ".45 is more powerful". That's simply not true anymore.
.45 can be just as good as 9mm even if it is more expensive. LOL.
Bottom line, choose the gun you like and use it. practice, practice, practice. Then practice a LOT more. Shot placement makes pistols a viable defense tool, not caliber.