Alter a nonunique index to a unique index

前端 未结 3 539
悲&欢浪女
悲&欢浪女 2021-01-11 11:46

I have a few non-unique constraints that I want to alter into unique constraints ( business rules have changed since the data model was made ). Is there any way to do it wi

3条回答
  •  佛祖请我去吃肉
    2021-01-11 12:14

    In my case, just do drop and re-create the index:

    DROP INDEX index_name;
    CREATE UNIQUE INDEX index_name ON table_name (col01,col02) TABLESPACE indx;
    

提交回复
热议问题