3 ms·
> but postgres' support means I still can should I ever need to. And since postgres supports indices on arbitrary expressions you can use CREATE INDEX for the
by fn1 5y ago
> but postgres' support means I still can should I ever need to.
And since postgres supports indices on arbitrary expressions you can use CREATE INDEX for the json-queries in your WHERE:
CREATE INDEX ON publishers((info->>'name'));
- dkersten 5y agoYes, Postgres' jsonb and array support lets you not only query into these fields, but also, like you say, index into them too. Its really the best of both worlds: you get a great solid relational database, but if you need document database features, you don't really lose out on anything by using json, except that the queries are a bit more ugly. I'm super happy with postgres these days, its rock solid and full of fantastic features.