default index for primary key of a table

Started by Nonameover 21 years ago2 messagesgeneral
Jump to latest
#1Noname
Vinita.Bansal@trilogy.com

Hi,

Postgres automatically creates index for Primary key of a table. I want to
turn this off, so that the default index is not created for primary key.
How can I do this??

Regards,
Vinita Bansal

#2Bruce Momjian
bruce@momjian.us
In reply to: Noname (#1)
Re: default index for primary key of a table

Vinita.Bansal@trilogy.com writes:

Postgres automatically creates index for Primary key of a table. I want to
turn this off, so that the default index is not created for primary key.
How can I do this??

Postgres does not support UNIQUE constraints (and PRIMARY KEY implies a UNIQUE
constraint) without an index. In Postgres the index is necessary to implement
the constraint.

In practice this doesn't usually cause any problem. Why do you want to do
this?

--
greg