So then the startup needs to get by with what it's got and earn money until they can afford it. Just like everyone else does with literally everything else.
Yes, and that is exactly the point: This means databases like Postgres or MySQL gets entrenched over options like KDB that costs a lot of even get started with. By the time they could afford the license, the cost of switching has risen dramatically.
E.g. I've worked on more than one startup where the first angel investment wasn't on the table before 6-12 months into development, and where that first round in some cases was below $250k
On top of that you also have the issue of finding someone that knows it, and the associated staffing risk that comes with that (yes, I'm sure you can always find someone, but at what price? there are place I can go where I couldn't throw a stone in any direction without hitting someone that "knows" Postgres or MySQL or both sufficiently well to be an acceptable tradeoff)
In many startups the tech choices end up being made not just based on what fits and what is affordable, but also based on what you can find affordable people to work with (including e.g. co-founders or other people willing to do initial work for equity) - sometimes that can lead to niche tech getting used. But far more often it means picking from a small set of the most common alternatives.