0

I have unique index which was created like this:

CREATE UNIQUE INDEX payment_idem_key_idx ON public.payment USING btree (contract_id, idempotency_key)

I want to remove the UNIQUE keyword from this index. How do I do it correctly? Should I somehow alter the index? Or should I drop it and then create a new one without the unique keyword? What would be the best practice in order not to lose anything.

I checked this thread, but the answer didn't really help me, because my unique index is not in constraint list. Or am I missing something?

developer1
  • 527
  • 4
  • 27
  • 3
    You will have to drop and re-create the index. –  Mar 06 '20 at 15:07
  • 1
    You should always question dropping unique. While dropping and recreating the index will not loose any data, be very sure you are not loosing a business requirement by allowing duplicates. – Belayer Mar 06 '20 at 18:19

0 Answers0