Hi,

I am actually migrating indexes from oracle database to postgres. I wanted to turn it off so that index on the same columns is not created again (index created for primary key of a table). I'll probably need to check in that case and not create the index if it is on the primary key of the table since that will be created by default.

That is the most simple sollution I think.

I am still not clear on why postgres has this restriction?
By uniqueness, you mean to say that if later anyone wants to add a primary key constraint on a table which already has a primary key defined, postgres will use this index to determine that there is already a primary key defined and would not allow to add this constraint since a table cannot have two primary keys??

No, PostgreSQL uses the index to check that the same value can not occur twice in the primary key field. A pretty important part of primary keys :-)


Sander.



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to