Hi! Thanks for review!

>  I think the patch should include some tests.  (Probably the behavior we want 
> is that the
> code simply ignores any indexes it cannot obtain an AEL on.)
> 

Attached V2 with simple test, that can be extended with test for parallel 
REINDEX CONCURRENTLY. On our tests it really creates deadlock... so the idea of

>  ignoring invalid indexes looks like a reasonable workaround for me
> 

and the syntax of SKIP LOCKED looks good for me too, can add it in
next version.

> 
> On the other hand, I wouldn't be opposed to having the feature you want,
> using a straight function as user interface (SELECT
> pg_drop_invalid_indexes()).

Seems like current implementation can be expanded with support of 
DROP INVALID INDEXES IN DATABASE/SCHEMA (ex: for table with partitions)
maybe it is an advantage over functions, in addition to <tab> completion.

Also, seems like lock behavior it can not be implemented with functions, but 
currently 
we have no agreement with that, so maybe it is not the reason, to do it in DDL..

--
Best regards,
Roman Khapov

Attachment: v2-0001-Add-DROP-INVALID-INDEXES-ON-TABLE-command.patch
Description: Binary data


Reply via email to