Weird behavior: deleted row still in index?

Поиск
Список
Период
Сортировка
От Phoenix Kiula
Тема Weird behavior: deleted row still in index?
Дата
Msg-id CAFWfU=vjqEMhUX+5ZuhYsXp_SJz4XE-2R2UeA3bu0HAb-beviw@mail.gmail.com
обсуждение исходный текст
Ответы Re: Weird behavior: deleted row still in index?
Re: Weird behavior: deleted row still in index?
Список pgsql-general
Hi.

I have deleted a row from a table. Confirmed by "SELECT". All
associated children tables don't have this key value either.

Yet, when I insert this row back again, the primary key index on this
table gives me a duplicate error.

As demonstrated below. PGSQL version is 9.0.5.

Is this common? I have vacuum analyzed the table three times. Still
same problem. Why is the primary key index keeping a value that was
deleted?

Short of a REINDEX (which will lock the entire table....it's a large
one) is there anything I can do to clear up the index?

Thanks!



mydb=# delete from stores where id = '20xrrs3';
DELETE 0
Time: 0.759 ms

mydb=# INSERT INTO stores (id) VALUES ('20xrrs3');
mydb-#
ERROR:  duplicate key value violates unique constraint "idx_stores_pkey"
DETAIL:  Key (id)=(20xrrs3) already exists.
mydb=#
mydb=#

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Foreign keys question (performance)
Следующее
От: Phoenix Kiula
Дата:
Сообщение: Re: Foreign keys question (performance)