JSON data type and schema validation

Started by Dmitry Shirokovover 10 years ago3 messages
#1Dmitry Shirokov
deadrunk@gmail.com

Hi all,

Are there any plans to introduce in next versions of Postgres a schema
validation for JSON field type? It would be very nice to have a support of
something like json-schema spec, see
http://json-schema.org/documentation.html. Right now there's the only way
to do it via individual constraints, which is not very convenient in most
cases. Please correct me if I'm wrong.

Cheers,
Dmitry

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Dmitry Shirokov (#1)
Re: JSON data type and schema validation

On 05/03/2015 11:20 PM, Dmitry Shirokov wrote:

Hi all,

Are there any plans to introduce in next versions of Postgres a schema
validation for JSON field type? It would be very nice to have a
support of something like json-schema spec, see
http://json-schema.org/documentation.html. Right now there's the only
way to do it via individual constraints, which is not very convenient
in most cases. Please correct me if I'm wrong.

Not that I know of. It should be possible to do as an extension and
applied with a check constraint.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Evgeniy Shishkin
itparanoia@gmail.com
In reply to: Dmitry Shirokov (#1)
Re: JSON data type and schema validation

On 04 May 2015, at 06:20, Dmitry Shirokov <deadrunk@gmail.com> wrote:

Hi all,

Are there any plans to introduce in next versions of Postgres a schema validation for JSON field type? It would be very nice to have a support of something like json-schema spec, see http://json-schema.org/documentation.html. Right now there's the only way to do it via individual constraints, which is not very convenient in most cases. Please correct me if I'm wrong.

Take a look at https://github.com/akorotkov/jsquery
You can find schema validation example in docs.

Cheers,
Dmitry

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers