Search Postgresql Archives

No implicit index created when adding primary key with ALTER TABLE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I observed some strange behaviour when adding a primary key with ALTER TABLE:

Given CREATE TABLE mytable1 (id serial, name text);
I filled it with data then did a
  CREATE TABLE mytable2 AS SELECT * FROM mytable1;
  ALTER TABLE mytable2 ADD PRIMARY KEY(id);

The last command reports - as usual - that implicitly an index on id
("mytable_pkey") was created - but it did not! It adds only a primary
key constraint on id. Can anybody explain this?

Yours, S.

P.S. I have installed "PostgreSQL 9.1alpha1, compiled by Visual C++
build 1500, 32-bit".

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux