Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group