Re: Key Vs Index - Mailing list pgsql-general

From Craig Ringer
Subject Re: Key Vs Index
Date
Msg-id 49927EE8.9010005@postnewspapers.com.au
Whole thread Raw
In response to Key Vs Index  (Abdul Rahman <abr_ora@yahoo.com>)
List pgsql-general
Abdul Rahman wrote:
>
> In Oracle, the index is automatically created during the creation of
> Primary Key.

The same is true in PostgreSQL. For example, here's a message from a
recent job I ran that created a temp table with SELECT ... INTO and
added a primary key to it:

psql:import_checks.sql:79: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will
create implicit index "check_weeks_pkey" for table "check_weeks"

Can you give an example of what you are talking about?

> But in PostgreSQL either index is implicitly created

Is "implicitly" in some way intended to mean something distinct to
"automatically"?

> I don't find any index against Primary
> Key and have to create index on this key.

AFAIK you CAN NOT have a PRIMARY KEY in PostgreSQL without an associated
unique index.

--
Craig Ringer

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Intel SSD
Next
From: Scott Marlowe
Date:
Subject: Re: Key Vs Index