logoalt Hacker News

orevyesterday at 3:44 PM2 repliesview on HN

I think you’re responding to the general idea of a relational database, not Postgres, and definitely not what’s in the article (DR;CA).

Postgres has built in data types and functions that allows it to work with unstructured json documents, like you would use in MongoDB.


Replies

aaaronicyesterday at 3:58 PM

That feature is definitely part of why it's still so relevant. The hstore approach wasn't nearly enough when it was all PG offered.

sgarlandyesterday at 10:52 PM

"Work with" != "work well." GIN indices aren't the same as B+tree, and even then, you'll have to decide / know about jsonb_path_ops vs. the default operator class. Or you just accept sub-optimal performance, I suppose.

The lack of a rigid schema makes it super fun as well. Does this attribute exist in this row? Who knows! Maybe there's a long-forgotten version lurking, waiting to be retrieved, that will utterly bork the calling app.