0

I have this statement in Postgres to create a unique index: CREATE UNIQUE INDEX CONCURRENTLY organization_user_ux1 ON organization_user (organization_id,user_id);

... I need to drop this unique index, so I tried:

ALTER TABLE public.organization_user DROP INDEX organization_user_ux1;

and recieved error: ERROR: syntax error at or near "organization_user_ux1" using flyway to execute these scripts.

How do I correctly undo this concurrent unique index?

1 Answer 1

1

Read This documentation for your reference Drop Index

IN your case :

DROP INDEX organization_user_ux1

or if you want it concurrently

DROP INDEX CONCURRENTLY organization_user_ux1
Sign up to request clarification or add additional context in comments.

1 Comment

@MaxMilovets All supported versions of PostgreSQL support drop index concurrently. If you are using a version so ancient that it does not, you should 1) upgrade urgently, 2) tell us the version, 3) not use features unsupported on the ancient version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.