Re: [GENERAL] difference in INDEX's - Mailing list pgsql-general

From Goran Thyni
Subject Re: [GENERAL] difference in INDEX's
Date
Msg-id 35A0B7B3.EF8FEE7A@bildbasen.se
Whole thread Raw
In response to difference in INDEX's  (Brian <signal@shreve.net>)
List 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...

pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: [GENERAL] :) Import file2table Question
Next
From: Stuart Rison
Date:
Subject: [GENERAL] nodeRead ERROR.