waiting on index drop

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: pgsql-general(at)postgresql(dot)org
Subject: waiting on index drop
Date: 2009-01-05 00:02:51
Message-ID: 49614E2B.3000500@zg.htnet.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

Does Postgres needs to wait for this lock
or is this something that can be fixed?

Create data:

create table test_table
(
id varchar primary key
);

insert into test_table
select i::text
from generate_series(1000,100000) i;

Session 1:
select * from test_table where id like '1050%';
Uses seq_scan

Session 2:
begin transaction;
create index ix_1 on test_table(id) where id like '1050%';
select * from test_table where id like '1050%';
Uses indx_scan

Session 1:
select * from test_table where id like '1050%';
Uses seq_scan (great, index is not visible)

Session 2:
drop index ix_1;
select * from test_table where id like '1050%';
Uses seq_scan

Session 1:
select * from test_table where id like '1050%';
Blocked

Session 2:
commit;
Session 1 continues

Regards,
Rikard

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-01-05 00:36:51 Re: waiting on index drop
Previous Message Tom Lane 2009-01-04 23:28:14 Re: SPI_ERROR_CONNECT in plperl function