Re: BUG #3833: Index remains when table is dropped

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #3833: Index remains when table is dropped
Дата
Msg-id 20071221125636.GD6115@alvh.no-ip.org
обсуждение исходный текст
Ответ на BUG #3833: Index remains when table is dropped  ("Laurenz Albe" <laurenz.albe@wien.gv.at>)
Ответы Re: BUG #3833: Index remains when table is dropped  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Laurenz Albe wrote:

> Two concurrent sessions perform statements against one database. The
> sessions are named s1 and s2 in this example.
>
> s1=> CREATE TABLE x(i integer);
>
> s2=> BEGIN;
> s2=> CREATE UNIQUE INDEX x_pkey ON x(i);
>
> s1=> DROP TABLE x;
> (Session hangs)
>
> s2=> COMMIT;
>
> Now Session s1 will unblock and succeed in dropping the table. The index,
> however, remains in pg_class, pg_depend, and pg_index.

Hmm.  So this is the bug that Tom mentioned on race conditions on
pg_depend.  Interesting.  I think the solution is to add more strict
locking when registering stuff in pg_depend, like the pg_shdepend code
does.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: "Laurenz Albe"
Дата:
Сообщение: BUG #3833: Index remains when table is dropped
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3833: Index remains when table is dropped