Top "Jsonb" questions

Binary version of the json data type, used in Postgres 9.4+. The major practical difference is efficiency.

How to get index of an array value in PostgreSQL?

I have a table called pins like this: id (int) | pin_codes (jsonb) -------------------------------- 1 | [4000, 5000, 6000] 2 | [8500, 8400, 8600] 3 | [2700, 2300, 2980] Now, I want the row with …

sql arrays postgresql jsonb
What's the proper index for querying structures in arrays in Postgres jsonb?

I'm experimenting with keeping values like the following in a Postgres jsonb field in Postgres 9.4: [{"event_slug":"test_1","start_time":"2014…

sql postgresql indexing set-returning-functions jsonb
Postgres jsonb 'NOT contains' operator

I'm experimenting with postgres jsonb column types, and so far so good. One common query I'm using is like this: …

postgresql postgresql-9.4 jsonb
SQLAlchemy filter according to nested keys in JSONB

I have a JSONB field that sometimes has nested keys. Example: {"nested_field": {"another URL": "foo", "a simple text": "text"}, "…

python sql postgresql sqlalchemy jsonb
ruby on rails jsonb column default value

I have a model ProjectKeyword where I use jsonb datatype in the column :segemnted_data class ProjectKeyword < ApplicationRecord belongs_…

ruby-on-rails postgresql activerecord jsonb
CTE and temporary index on PostgreSQL

I work on postgres database where I'll using a mix of relational tables and jsonb tables (which can be indexed). …

postgresql temp-tables postgresql-9.4 jsonb
Postgres coalesce to empty JSONB array

How can I coalesce a null column into an empty JSONB array? This doesn't work: SELECT jsonb_array_elements(coalesce(…

sql arrays postgresql coalesce jsonb
In Django 1.9, what's the convention for using JSONField (native postgres jsonb)?

Django highly suggests not to use null=True for CharField and TextField string-based fields in order not to have two …

python json django postgresql jsonb
Postgres query result to json object

My query is given below SELECT w.payload, Count('payload') OVER () AS ROWCOUNT FROM wholesale_confirmation.wholesale_order_confirmation w …

postgresql pagination aggregate-functions jsonb sql-limit
postgresql 9.5 using jsonb_set for updating specific jsonb array value

Currently I am working with postgreSQL 9.5 and try to update a value inside an array of a jsonb field. But …

arrays json postgresql sql-update jsonb