Can I drop primary key index without dropping primary key constraint in postgresql?
Your question is a bit confusing. I think you must mean this:
Can I drop an index on a column but still keep the uniqueness constraint on that column?
No. A uniqueness constraint requires an index. You can make your constraint into an ordinary non-primary index, but you can't make it not an index.
Also, read about primary keys in the documentation:
Technically, a primary key constraint is simply a combination of a unique constraint and a not-null constraint.
So if a column is a primary key it has by definition a unique constraint and therefore also an index. You cannot have a primary key that isn't an index.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With