Re: default index created for primary key

From: "vinita bansal" <sagivini(at)hotmail(dot)com>
To: steffann(at)nederland(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: default index created for primary key
Date: 2004-12-22 17:09:26
Message-ID: BAY20-F4150837800E7916AD79111CBA40@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

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??

Thanks,
Vinita Bansal

>From: "Sander Steffann" <steffann(at)nederland(dot)net>
>To: "'vinita bansal'" <sagivini(at)hotmail(dot)com>,<pgsql-general(at)postgresql(dot)org>
>Subject: Re: [GENERAL] default index created for primary key
>Date: Wed, 22 Dec 2004 16:50:58 +0100
>
>Hi,
>
> > I want to turn off the default setting in postgres for index
> > creation on primary key of a table. Is it possible and how?
>
>That is not possible, because the index is used to guarantee
>the uniqueness of the primary key.
>
>What is the reason you want to turn it off?
>Sander.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster

_________________________________________________________________
Pep up your screen! Kickstart your day!
http://www.msn.co.in/Cinema/screensaver/ Get these vibrant screensavers!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2004-12-22 17:18:11 Re: increasing max_connections on freebsd
Previous Message Martijn van Oosterhout 2004-12-22 17:08:05 Re: Strange Index behavior