BrazilJS

Share this post
Melhor suporte a JSON no PostgreSQL 14
www.braziljs.org

Melhor suporte a JSON no PostgreSQL 14

Agora, no PostgreSQL 14, o suporte JSON está ainda melhor e mais amigável do que antes.

BrazilJS
Jun 15, 2021
2
Share this post
Melhor suporte a JSON no PostgreSQL 14
www.braziljs.org

O PostgreSQL já possui suporte a JSON há quase 10 anos,
No início, havia apenas uma validação do JSON e o armazenamento era em um campo de texto padrão.
Já no PostgreSQL 9.4 o suporte JSON melhorou com a introdução do tipo de dados JSONB.
Agora, no PostgreSQL 14, o suporte JSONB está ainda melhor e mais amigável do que antes.

Veja um exemplo de mudança de sintaxe:

--PostgreSQL 13
SELECT *
FROM shirts
WHERE details->'attributes'->>'color' = 'neon yellow'
AND details->'attributes'->>'size' = 'medium';
--PostgreSQL 14
SELECT *
FROM shirts
WHERE details['attributes']['color'] = '"neon yellow"'
AND details['attributes']['size'] = '"medium"'
view raw pg14.sql hosted with ❤ by GitHub

Saiba mais: https://blog.crunchydata.com/blog/better-json-in-postgres-with-postgresql-14

Share this post
Melhor suporte a JSON no PostgreSQL 14
www.braziljs.org
Comments

Create your profile

0 subscriptions will be displayed on your profile (edit)

Skip for now

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.

TopNewCommunity

No posts

Ready for more?

© 2022 BrazilJS
Privacy ∙ Terms ∙ Collection notice
Publish on Substack Get the app
Substack is the home for great writing