Re: No implicit index created when adding primary key with ALTER TABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Keller <sfkeller(at)gmail(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: No implicit index created when adding primary key with ALTER TABLE
Date: 2011-06-14 22:39:43
Message-ID: 10127.1308091183@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stefan Keller <sfkeller(at)gmail(dot)com> writes:
> My explanation is that the message (saying that an index was
> implicitly created) is simply wrong.

The correct explanation is that you're misinterpreting whatever output
you're looking at. Every unique or pkey constraint has an underlying
index --- the index is the implementation mechanism for the constraint,
so this is assuredly so. Some tools that show both constraints and
indexes will omit constraint-associated indexes from the listing, since
otherwise they'd be showing duplicate information.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-06-14 22:48:14 Re: No implicit index created when adding primary key with ALTER TABLE
Previous Message Stefan Keller 2011-06-14 22:31:12 Re: No implicit index created when adding primary key with ALTER TABLE