Re: Question about Indexes...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alan T(dot) Miller" <amiller(at)hollywood101(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Question about Indexes...
Date: 2004-01-03 16:52:30
Message-ID: 21479.1073148750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Alan T. Miller" <amiller(at)hollywood101(dot)com> writes:
> If I create a table and assign the column type for what will be the primary
> key the value of "Serial", do I need to explicitly create an index in
> addition?

Either PRIMARY KEY or UNIQUE implies an index (for any column datatype).
They even put out notices to tell you so.

> I was thinking that a Serial, would automatically be a Unique Index wouldn't
> it?

Not in recent releases --- a SERIAL column is just an integer with a
special default value.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message G. Walsh 2004-01-03 18:25:13 More on creating data bases for 4 distinct users
Previous Message Andreas 2004-01-03 15:26:15 Re: Question about Indexes...