SERIAL + PRIMARY KEY = redundant indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: SERIAL + PRIMARY KEY = redundant indexes
Date: 1999-05-11 14:05:33
Message-ID: 13301.926431533@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

With current sources:

regression=> create table t1 ( f1 serial primary key );
NOTICE: CREATE TABLE will create implicit sequence t1_f1_seq for SERIAL column t1.f1
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index t1_pkey for table t1
CREATE

OK so far ...

regression=> create table t2 ( f1 serial,
regression-> primary key (f1) );
NOTICE: CREATE TABLE will create implicit sequence t2_f1_seq for SERIAL column t2.f1
NOTICE: CREATE TABLE/UNIQUE will create implicit index t2_f1_key for table t2
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index t2_pkey for table t2
CREATE

And, indeed, it's made two separate indexes on t2's f1 field. This is
a bug, no?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-05-11 14:18:16 Re: [HACKERS] Re: [SQL] plpgsql error
Previous Message Tom Lane 1999-05-11 14:01:08 Re: [INTERFACES] Bug in psql?