I'm trying to use new Postgresql 9.5 upsert feature. But for some reason my query saying constraint doesn't exist (when it does).
My query is this
INSERT INTO journals (ext_ids, title) VALUES ('{"nlmid": "000"}', 'blah')
ON CONFLICT ON CONSTRAINT idx_nlmid_journal DO NOTHING;
where idx_nlmid_journal is unique index on jsonb field created like this
CREATE UNIQUE INDEX idx_nlmid_journal ON public.journals ((ext_ids ->> 'nlmid'::text));
I get error
ERROR: constraint "idx_nlmid_journal" for table "journals" does not exist
what am I missing ?