Add two missing cases to ATWrongRelkindError.
authorRobert Haas
Thu, 22 Oct 2015 21:00:53 +0000 (17:00 -0400)
committerRobert Haas
Thu, 22 Oct 2015 21:04:18 +0000 (17:04 -0400)
This way, we produce a better error message if someone tries to do
something like ALTER INDEX .. ALTER COLUMN .. SET STORAGE.

Amit Langote

src/backend/commands/tablecmds.c

index 3ed9c380fc23683d76d55518607b49d50547a612..f359a9098e73488ef080f4b36c2684ef4d2e1547 100644 (file)
@@ -4339,6 +4339,9 @@ ATWrongRelkindError(Relation rel, int allowed_targets)
        case ATT_TABLE | ATT_VIEW:
            msg = _("\"%s\" is not a table or view");
            break;
+       case ATT_TABLE | ATT_VIEW | ATT_FOREIGN_TABLE:
+           msg = _("\"%s\" is not a table, view or foreign table");
+           break;
        case ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX:
            msg = _("\"%s\" is not a table, view, materialized view, or index");
            break;
@@ -4348,6 +4351,9 @@ ATWrongRelkindError(Relation rel, int allowed_targets)
        case ATT_TABLE | ATT_MATVIEW | ATT_INDEX:
            msg = _("\"%s\" is not a table, materialized view, or index");
            break;
+       case ATT_TABLE | ATT_MATVIEW | ATT_FOREIGN_TABLE:
+           msg = _("\"%s\" is not a table, materialized view, or foreign table");
+           break;
        case ATT_TABLE | ATT_FOREIGN_TABLE:
            msg = _("\"%s\" is not a table or foreign table");
            break;