Re: jsonb unique constraints

2020-05-05 Thread Ted Toth
I was able to create a unique index, thanks. On Tue, May 5, 2020 at 10:38 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, May 5, 2020 at 8:33 AM Ted Toth wrote: > >> Can you have unique constraints on jsonb columns keys? I've looked for >> examples but haven't found any what

Re: jsonb unique constraints

2020-05-05 Thread David G. Johnston
On Tue, May 5, 2020 at 8:33 AM Ted Toth wrote: > Can you have unique constraints on jsonb columns keys? I've looked for > examples but haven't found any what is the proper syntax? Here's what I > tried: > > CREATE TABLE report_json ( > recnum int, > id integer, > report jsonb, > P

jsonb unique constraints

2020-05-05 Thread Ted Toth
Can you have unique constraints on jsonb columns keys? I've looked for examples but haven't found any what is the proper syntax? Here's what I tried: CREATE TABLE report_json ( recnum int, id integer, report jsonb, PRIMARY KEY (recnum), CONSTRAINT report_json_unique_constraint