]> granicus.if.org Git - postgresql/commitdiff
Disable creation of indexes on system tables.
authorBruce Momjian <bruce@momjian.us>
Mon, 2 Apr 2001 14:34:25 +0000 (14:34 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 2 Apr 2001 14:34:25 +0000 (14:34 +0000)
src/backend/catalog/index.c

index 3b150e5340be2c97f618374274b8e89bbd9a0b63..2adb30e1ed8ecf91d12c0028495b8911ece7068d 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.144 2001/03/22 06:16:10 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.145 2001/04/02 14:34:25 momjian Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -864,6 +864,10 @@ index_create(char *heapRelationName,
                indexInfo->ii_NumKeyAttrs < 1)
                elog(ERROR, "must index at least one attribute");
 
+       if (heapRelationName && !allow_system_table_mods &&
+               IsSystemRelationName(heapRelationName) && IsNormalProcessingMode())
+               elog(ERROR, "User-defined indexes on system catalogs are not supported");
+
        /*
         * get heap relation oid and open the heap relation
         */