1

When defining unique indices in PostgreSQL you have two options:

  • Define unique index using constraint with the table via a single statement
  • Define index later after table is created using separate CREATE INDEX statement

However, when it comes to unique partial indices, is it possible to create one with the table using single statement or do I have to use a separate statement?

I would prefer to define all the indices with the table.

1
  • This question stackoverflow.com/questions/6239657/… is a bit old but it still appears to be the case that you can't create an index other than simple constraints during the table creation statement. Commented Jun 9, 2017 at 16:30

0

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.