r/programming • • Sep 24 '20

PostgreSQL 13 Released!

https://www.postgresql.org/about/news/2077/
1.3k Upvotes

236 comments sorted by

View all comments

Show parent comments

6

u/Dokiace Sep 24 '20

So it's been out for a while huh, how come I never heard of this, so you can just INSERT <JSON> into TABLE and it will handle that?

17

u/booboorocks998 Sep 24 '20

They get inserted like strings. But the column type has a bunch of special features, like you can query into the json for your select or check a value in the where.

https://www.postgresqltutorial.com/postgresql-json/

2

u/Dokiace Sep 24 '20

is this not implemented widely in the industry? I dont have that much professional experience but I haven't seen this one implemented anywhere in the production

10

u/booboorocks998 Sep 24 '20

Not likely if your database has been around for more than a couple years.

Even Microsoft SQL Server supports json columns now though, so it's sort of picking up.

When you use that type, you trade off most of the benefits of relational data. So it is only really great for some use cases. But for those use cases, it is awesome!

It's also a nice way to just store blobs of data in a database rather than a file system or cloud storage. You don't lose out on the relational features since you wouldn't have them with the alternatives anyways.