From 8cb53654dbdb4c386369eb988062d0bbb6de725e Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Fri, 6 Apr 2012 10:21:40 +0100 Subject: Add DROP INDEX CONCURRENTLY [IF EXISTS], uses ShareUpdateExclusiveLock --- doc/src/sgml/ref/drop_index.sgml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml index 7177ef2d81b..343f7aca003 100644 --- a/doc/src/sgml/ref/drop_index.sgml +++ b/doc/src/sgml/ref/drop_index.sgml @@ -21,7 +21,7 @@ PostgreSQL documentation -DROP INDEX [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] +DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] @@ -49,6 +49,29 @@ DROP INDEX [ IF EXISTS ] name [, .. + + CONCURRENTLY + + + When this option is used, PostgreSQL will drop the + index without taking any locks that prevent concurrent selects, inserts, + updates, or deletes on the table; whereas a standard index drop + waits for a lock that locks out everything on the table until it's done. + Concurrent drop index is a two stage process. First, we mark the index + both invalid and not ready then commit the change. Next we wait until + there are no users locking the table who can see the index. + + + There are several caveats to be aware of when using this option. + Only one index name can be specified if the CONCURRENTLY + parameter is specified. Regular DROP INDEX command can be + performed within a transaction block, but + DROP INDEX CONCURRENTLY cannot. + The CASCADE option is not supported when dropping an index concurrently. + + + + name -- cgit v1.2.3