]> granicus.if.org Git - postgresql/commitdiff
Fix some omissions in the dependency-object-class support for SQL/MED objects.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Aug 2009 15:27:56 +0000 (15:27 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Aug 2009 15:27:56 +0000 (15:27 +0000)
Main problem found by Muhammad Aqeel, some cosmetic additions by me.

src/backend/catalog/dependency.c
src/backend/commands/tablecmds.c

index 8181cae64a53049e270800d44913956541124610..f0d3f03e4a4e5a8322919592de8dc47ee8a7ea12 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.89 2009/06/11 14:48:54 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.90 2009/08/07 15:27:56 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -143,7 +143,10 @@ static const Oid object_classes[MAX_OCLASS] = {
        TSConfigRelationId,                     /* OCLASS_TSCONFIG */
        AuthIdRelationId,                       /* OCLASS_ROLE */
        DatabaseRelationId,                     /* OCLASS_DATABASE */
-       TableSpaceRelationId            /* OCLASS_TBLSPACE */
+       TableSpaceRelationId,           /* OCLASS_TBLSPACE */
+       ForeignDataWrapperRelationId,   /* OCLASS_FDW */
+       ForeignServerRelationId,        /* OCLASS_FOREIGN_SERVER */
+       UserMappingRelationId           /* OCLASS_USER_MAPPING */
 };
 
 
@@ -1115,20 +1118,23 @@ doDeletion(const ObjectAddress *object)
                        RemoveTSConfigurationById(object->objectId);
                        break;
 
-               case OCLASS_USER_MAPPING:
-                       RemoveUserMappingById(object->objectId);
+                       /*
+                        * OCLASS_ROLE, OCLASS_DATABASE, OCLASS_TBLSPACE intentionally
+                        * not handled here
+                        */
+
+               case OCLASS_FDW:
+                       RemoveForeignDataWrapperById(object->objectId);
                        break;
 
                case OCLASS_FOREIGN_SERVER:
                        RemoveForeignServerById(object->objectId);
                        break;
 
-               case OCLASS_FDW:
-                       RemoveForeignDataWrapperById(object->objectId);
+               case OCLASS_USER_MAPPING:
+                       RemoveUserMappingById(object->objectId);
                        break;
 
-                       /* OCLASS_ROLE, OCLASS_DATABASE, OCLASS_TBLSPACE not handled */
-
                default:
                        elog(ERROR, "unrecognized object class: %u",
                                 object->classId);
index 1f2d67bcb127741a8beb712e2b19a489d0dc6049..f51f1f8c487dd03cd00797c415b37e95346b7f41 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.295 2009/08/02 22:14:52 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.296 2009/08/07 15:27:56 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -6037,12 +6037,20 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
                        case OCLASS_OPERATOR:
                        case OCLASS_OPCLASS:
                        case OCLASS_OPFAMILY:
+                       case OCLASS_AMOP:
+                       case OCLASS_AMPROC:
                        case OCLASS_TRIGGER:
                        case OCLASS_SCHEMA:
                        case OCLASS_TSPARSER:
                        case OCLASS_TSDICT:
                        case OCLASS_TSTEMPLATE:
                        case OCLASS_TSCONFIG:
+                       case OCLASS_ROLE:
+                       case OCLASS_DATABASE:
+                       case OCLASS_TBLSPACE:
+                       case OCLASS_FDW:
+                       case OCLASS_FOREIGN_SERVER:
+                       case OCLASS_USER_MAPPING:
 
                                /*
                                 * We don't expect any of these sorts of objects to depend on