If you're in software and know the internal workings of Postgres, well that's fine and dandy iff a business decides to use Postgres. Maybe they chose MariaDB or something else arbitrary instead. That highly specialized knowledge you have about Postgres is highly dependent on demand as it always has been. The difference now is that for any given technology, there seem to be a sea of competing options, so the risk of your expert time investment having no demand is quite high. The salaries may be high but I'd argue they're not high enough for the time, effort, and risk to become a specific technology expert anymore. I have expert level knowledge in systems that now have almost no demand. It's a waste of my time to maintain them at this point, the risk and opportunity cost is far far too high.
There was a time when you could become an expert or near expert of about 1-3 competitors for a specific library of infrastructure and those skills were incredibly valuable, highly transferable, and in demand because the pool of competing tech was so low. Now I can't even keep track of number of just say database or database like applications teams may choose to use. There's more diversity than there is demand to justify and sustain the evel of diversity we now have, IMO.
But that was always the case. Lets say you can save a company millions of dollars by being competent at SQL. Guess what? Any of the millions of people who are competent at SQL could also have saved that company millions of dollars. Why not just hire anyone of those? You are a part of the sea of programmers with similar skills as yourself, that is what you are selling and what companies are buying. So to set yourself apart from the sea of others you show you are smart enough or hard working enough to pass coding interviews, since most of your peers who also know SQL can't pass those.