Currently, we attempt to create the index and if it fails we just do _.noop()
MongoDB checks for index options collision but PostgreSQL doesn't check for that yet
indexDef in PostgreSQL table is converted (not sure by which logic) to something else than what we trigger so we cannot compare.
CREATE INDEX idx_btree_objectmds_bucket ON public.objectmds USING btree (((data ->> 'bucket'::text))) WHERE (((data -> 'deleted'::text) IS NULL) OR ((data -> 'deleted'::text) = 'null'::jsonb))
There is obviously an option to create a temp index and take his indexDef and then compare but it is costly.
This happens when we edit existing indexes that have a name in their options.
Also happens when there is an error in the DB and we somehow fail to create the index.
Expected behavior
Index changes should be handled (deletion and recreation of the index with updated changes)
Steps to reproduce
Create index (one that has a name in the options)
Kill the system
Edit the code and add more fields to the index
Bring up the system and see that the index did not update
More information - Screenshots / Logs / Other output
Environment info
Actual behavior
CREATE INDEX idx_btree_objectmds_bucket ON public.objectmds USING btree (((data ->> 'bucket'::text))) WHERE (((data -> 'deleted'::text) IS NULL) OR ((data -> 'deleted'::text) = 'null'::jsonb))
There is obviously an option to create a temp index and take his indexDef and then compare but it is costly.name
in their options.Expected behavior
Steps to reproduce
name
in the options)More information - Screenshots / Logs / Other output