bookmark

Faster Operations with the JSONB Data Type in PostgreSQL - Compose Articles


Description

CREATE TABLE books (
book_id serial NOT NULL, data jsonb );

INSERT INTO books VALUES (1, '{"title": "Sleeping Beauties", "genres": ["Fiction", "Thriller", "Horror"], "published": false}');

SELECT data->'title' AS title FROM books WHERE data->'published' = 'false';

CREATE INDEX idx_published ON books ((data->'published'));

Preview

Tags

Users

  • @jil

Comments and Reviews