Re: No implicit index created when adding primary key with ALTER TABLE - Mailing list pgsql-general

From Adrian Klaver
Subject Re: No implicit index created when adding primary key with ALTER TABLE
Date
Msg-id 201106141548.15513.adrian.klaver@gmail.com
Whole thread Raw
In response to Re: No implicit index created when adding primary key with ALTER TABLE  (Stefan Keller <sfkeller@gmail.com>)
List pgsql-general
On Tuesday, June 14, 2011 3:31:12 pm Stefan Keller wrote:
> Hi Thom
>
> 2011/6/14 Thom Brown <thom@linux.com>:
> > Shouldn't you be looking for mytable2_pkey?
>
> Yes; but that was my typo. I tried it several times on two tables.
> My explanation is that the message (saying that an index was
> implicitly created) is simply wrong.

Works here:

test(5432)aklaver=>SELECT version();
                                             version
--------------------------------------------------------------------------------------------------
 PostgreSQL 9.0.3 on i686-pc-linux-gnu, compiled by GCC gcc (Ubuntu
4.4.3-4ubuntu5) 4.4.3, 32-bit
(1 row)


test(5432)aklaver=>  ALTER TABLE mytable2 ADD PRIMARY KEY(id);
                                                           
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index
"mytable2_pkey" for table "mytable2"
ALTER TABLE
                                                           
test(5432)aklaver=>\d+ mytable2
                Table "public.mytable2"
                                                           
 Column |  Type   | Modifiers | Storage  | Description
                                                           
--------+---------+-----------+----------+-------------
                                                           
 id     | integer | not null  | plain    |
 name   | text    |           | extended |
Indexes:
    "mytable2_pkey" PRIMARY KEY, btree (id)
Has OIDs: no

Note the btree designation.

>
> Yours, S.

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: No implicit index created when adding primary key with ALTER TABLE
Next
From: Craig Ringer
Date:
Subject: Re: random backend crashes - how to debug ( Is crash dump handler released ? )