I'm using a PostgreSQL 9.4 database. In my bo_lesson
table, I have a metadata
field that is of jsonb
type.
Column | Type | Modifiers |
---------------+--------------------------------+---------------------------------|
id | integer | not null |
level | integer | |
slug | text | not null |
description | text | |
external_link | character varying(255) | default NULL::character varying |
metadata | jsonb | |
name | character varying(255) | not null |
created_at | timestamp(0) without time zone | not null |
updated_at | timestamp(0) without time zone | not null |
status | character varying(45) | not null |
But when I execute this query
INSERT INTO bo_lesson (id, level, slug, description, external_link, metadata, name,
created_at, updated_at, status)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
parameters: $1 = '4', $2 = '1', $3 = 'education-3', $4 = NULL, $5 = NULL,
$6 = '"what ever [ i need }} \""', $7 = 'education',
$8 = '2015-07-30 14:33:01', $9 = '2015-07-30 14:33:01', $10 = 'draft'
The line is properly inserted.
id | level | slug | description | external_link | metadata | name | created_at | updated_at | status
----+-------+-------------+-------------+---------------+----------------------------+-----------+---------------------+---------------------+--------
4 | 1 | education-3 | | | "what ever [ i need }} \"" | education | 2015-07-30 14:33:01 | 2015-07-30 14:33:01 | draft
The jsonb
field hasn't done any validation on what is inserted. I've read that it it supposed to do so. Did I miss a configuration option?