DatabaseStatusSyntax FamilyMin Version
PostgreSQL full json-jsonb 9.2
MySQL full json 5.7.8
MariaDB partial json 10.2.7
Oracle full json 21c
SQL Server partial - -
SQLite partial - 3.9.0
Redshift partial - -
DB2 partial - 11.1
Snowflake partial - -
BigQuery full json -

Compare Databases

Database Details

PostgreSQL full
CREATE TABLE events (
  id SERIAL PRIMARY KEY,
  payload JSONB NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • JSON type stores an exact text copy; JSONB stores a decomposed binary format.
  • JSONB supports GIN indexing for fast containment and existence queries.
  • Prefer JSONB unless you specifically need to round-trip the original text (whitespace, key order, duplicate keys).
MySQL full
CREATE TABLE events (
  id INT AUTO_INCREMENT PRIMARY KEY,
  payload JSON NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • JSON is stored in an internal binary format for efficient access.
  • Validates that values are well-formed JSON on insert.
  • Supports multi-valued indexes on JSON arrays as of MySQL 8.0.17.
MariaDB partial
CREATE TABLE events (
  id INT AUTO_INCREMENT PRIMARY KEY,
  payload JSON NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • JSON column type added in MariaDB 10.2.7 (alias for LONGTEXT with JSON validation).
  • JSON_VALID(), JSON_COMPACT(), JSON_DETAILED() functions available.
  • JSON type validates that stored content is valid JSON.
  • Internally stored as LONGTEXT.
  • Functionally similar to MySQL's JSON type, but not implemented as a distinct physical JSON storage type.
Oracle full
CREATE TABLE events (
  id NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  payload JSON NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • Native JSON data type introduced in Oracle 21c with binary storage format (OSON).
  • Prior versions store JSON in VARCHAR2, CLOB, or BLOB columns with IS JSON check constraints.
  • Supports JSON search indexes for fast querying.
SQL Server partial
CREATE TABLE events (
  id INT IDENTITY PRIMARY KEY,
  payload NVARCHAR(MAX) NOT NULL
    CHECK (ISJSON(payload) = 1)
);

INSERT INTO events (payload)
VALUES (N'{"type": "click", "x": 100, "y": 200}');
  • No native JSON column type; JSON is stored in NVARCHAR columns.
  • Use ISJSON() in a CHECK constraint to enforce valid JSON.
  • SQL Server 2016 introduced built-in JSON functions but not a dedicated type.
  • A native json type is available in preview in SQL Server 2025.
SQLite partial
CREATE TABLE events (
  id INTEGER PRIMARY KEY,
  payload TEXT NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • No dedicated JSON column type; JSON is stored as TEXT.
  • JSON functions (json(), json_valid()) are available for validation and manipulation.
  • The json() function can normalize and validate JSON text.
Redshift partial
CREATE TABLE events (
  id INT IDENTITY PRIMARY KEY,
  payload SUPER NOT NULL
);

INSERT INTO events (payload)
SELECT PARSE_JSON('{"type": "click", "x": 100, "y": 200}');
  • SUPER type stores semi-structured data including JSON.
  • PARSE_JSON('...') creates a SUPER value; JSON_SERIALIZE() converts back to string.
  • SUPER is not a dedicated JSON type - it stores any semi-structured format.
  • Uses PartiQL for querying SUPER data.
  • More flexible but less standards-aligned than SQL/JSON.
DB2 partial
CREATE TABLE events (
  id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  payload VARCHAR(32672) NOT NULL
);

INSERT INTO events (payload)
VALUES ('{"type": "click", "x": 100, "y": 200}');
  • JSON functions added in DB2 11.1.
  • JSON stored as VARCHAR(32672) or CLOB - no dedicated JSON column type.
  • JSON_OBJECT, JSON_ARRAY constructors available.
  • JSON functions provide validation and extraction.
Snowflake partial
CREATE TABLE events (
  id INT AUTOINCREMENT PRIMARY KEY,
  payload VARIANT NOT NULL
);

SELECT PARSE_JSON('{"name":"Alice","age":30}') AS v, v:name::STRING;
  • Snowflake has no JSON-only type; JSON documents are stored in VARIANT alongside Avro, XML, and Parquet-derived data.
  • PARSE_JSON(string) parses JSON into VARIANT; TO_JSON(variant) serializes back.
BigQuery full
CREATE TABLE events (
  id INT64,
  payload JSON
);

SELECT json_col.user.name
FROM t
WHERE JSON_VALUE(json_col, '$.user.age') > '25';
  • JSON type (native, 2022) for JSON-typed columns.
  • STRING type for legacy JSON storage (use JSON_VALUE/JSON_QUERY).
  • Also native STRUCT and ARRAY types available.
  • The JSON type allows schema-free JSON document storage with direct access syntax.
  • JSON_VALUE, JSON_QUERY, JSON_EXTRACT functions work on both JSON and STRING types.
Docs: JSON data