aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/indexcmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-06-14 18:04:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-06-14 18:04:34 +0000
commit0cefb50f3ce964d6097aad64dabd9b544c3d2e68 (patch)
tree4e1ee9454bc958d35194062eee8894205cd08da5 /src/backend/commands/indexcmds.c
parent95ce4ee943f226152ac8c147da178af5d1a95909 (diff)
downloadpostgresql-0cefb50f3ce964d6097aad64dabd9b544c3d2e68.tar.gz
postgresql-0cefb50f3ce964d6097aad64dabd9b544c3d2e68.zip
Refactor the handling of the various DropStmt variants so that when multiple
objects are specified, we drop them all in a single performMultipleDeletions call. This makes the RESTRICT/CASCADE checks more relaxed: it's not counted as a cascade if one of the later objects has a dependency on an earlier one. NOTICE messages about such cases go away, too. In passing, fix the permissions check for DROP CONVERSION, which for some reason was never made role-aware, and omitted the namespace-owner exemption too. Alex Hunsaker, with further fiddling by me.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r--src/backend/commands/indexcmds.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 05eb55e8699..a8a78b561fb 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.176 2008/05/12 20:01:59 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.177 2008/06/14 18:04:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,7 +21,6 @@
#include "access/transam.h"
#include "access/xact.h"
#include "catalog/catalog.h"
-#include "catalog/dependency.h"
#include "catalog/heap.h"
#include "catalog/index.h"
#include "catalog/indexing.h"
@@ -1256,33 +1255,6 @@ relationHasPrimaryKey(Relation rel)
return result;
}
-
-/*
- * RemoveIndex
- * Deletes an index.
- */
-void
-RemoveIndex(RangeVar *relation, DropBehavior behavior)
-{
- Oid indOid;
- char relkind;
- ObjectAddress object;
-
- indOid = RangeVarGetRelid(relation, false);
- relkind = get_rel_relkind(indOid);
- if (relkind != RELKIND_INDEX)
- ereport(ERROR,
- (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("\"%s\" is not an index",
- relation->relname)));
-
- object.classId = RelationRelationId;
- object.objectId = indOid;
- object.objectSubId = 0;
-
- performDeletion(&object, behavior);
-}
-
/*
* ReindexIndex
* Recreate a specific index.