Re: [GENERAL] difference in INDEX's

From: Goran Thyni <goran(at)bildbasen(dot)se>
To: Brian <signal(at)shreve(dot)net>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] difference in INDEX's
Date: 1998-07-06 11:40:35
Message-ID: 35A0B7B3.EF8FEE7A@bildbasen.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brian wrote:
> Is there a difference in doing:
>
> foo int PRIMARY KEY
>
> and
>
> CREATE INDEX idx1 on table (foo);

Yes,

create table bar (foo int PRIMARY KEY);

is the same as

create table bar (foo int NOT NULL); CREATE UNIQUE INDEX bar_pkey on
table bar(foo);

The first is easier to type,
the second is preferable (faster) if you will initially do a lot of
inserts, like:

create table...
loads of inserts...
create unique index...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stuart Rison 1998-07-06 12:27:49 [GENERAL] nodeRead ERROR.
Previous Message Oliver Elphick 1998-07-06 10:12:16 Re: [GENERAL] :) Import file2table Question