2

I have a table which looks like this:

        Column        |          Type           |
----------------------+-------------------------+
...
 thing                | tsvector                | 
...

Indexes:
...
...
    "thing" gin (thing)

The size of the table is about 200,000 records.

I want to get rid of this field and its index, but Postgres doesn't seem to want to let me. The value of all of the field in all records is an empty tsvector.

When I issue either

alter table my_table drop column thing;

or

drop index thing ;

it takes hours and eventually I halt it.

Neither the CPU or RAM looks particularly high. There are no other clients connected.

1 Answer 1

4

Looks like a locking problem. Did you check pg_locks?

SELECT    
  *  
FROM
  pg_class 
    JOIN pg_locks ON pg_locks.relation = pg_class.oid;
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! That was it. Don't know quite how it happened though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.