DropErrorMsg() died with assert failure if try to drop a toast table...
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Nov 2000 02:17:50 +0000 (02:17 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Nov 2000 02:17:50 +0000 (02:17 +0000)
mea culpa...

src/backend/tcop/utility.c

index dd8bfe017a6100c23054d9c38f14544f40bd7e71..9ee7267f7009bebd85b21647472c9d288bfcdd27 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.99 2000/11/05 22:50:21 vadim Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.100 2000/11/07 02:17:50 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -80,11 +80,14 @@ DropErrorMsg(char* relname, char wrongkind, char rightkind)
        for (wentry = kindstringarray; wentry->kind != '\0'; wentry++)
                if (wentry->kind == wrongkind)
                        break;
-       Assert(wentry->kind != '\0');
-       
-       elog(ERROR, "\"%s\" is not %s %s. Use DROP %s to remove %s %s",
-                relname, rentry->indef_article, rentry->name,
-                wentry->command, wentry->indef_article, wentry->name);
+       /* wrongkind could be something we don't have in our table... */
+       if (wentry->kind != '\0')
+               elog(ERROR, "\"%s\" is not %s %s. Use DROP %s to remove %s %s",
+                        relname, rentry->indef_article, rentry->name,
+                        wentry->command, wentry->indef_article, wentry->name);
+       else
+               elog(ERROR, "\"%s\" is not %s %s",
+                        relname, rentry->indef_article, rentry->name);
 }
 
 static void