diff options
| author | Cédric Villemain | 2011-05-13 20:55:39 +0000 |
|---|---|---|
| committer | Cédric Villemain | 2011-05-13 20:55:39 +0000 |
| commit | e0c3b474d5436c7874aef36988f2646bdb890249 (patch) | |
| tree | 49c41d2b8abbd9bae4096643d840859f3a02a08c /src/backend/commands/indexcmds.c | |
| parent | 40cefa392974c73ec20deb3c15fb5111ed7fad17 (diff) | |
| parent | 9bb6d9795253bb521f81c626fea49a704a369ca9 (diff) | |
Merge branch 'master' into analyze_cacheanalyze_cache
Diffstat (limited to 'src/backend/commands/indexcmds.c')
| -rw-r--r-- | src/backend/commands/indexcmds.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ff84045d4f..b91e4a4bd2 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -183,10 +183,22 @@ DefineIndex(RangeVar *heapRelation, /* Note: during bootstrap may see uncataloged relation */ if (rel->rd_rel->relkind != RELKIND_RELATION && rel->rd_rel->relkind != RELKIND_UNCATALOGED) - ereport(ERROR, - (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("\"%s\" is not a table", - heapRelation->relname))); + { + if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE) + /* + * Custom error message for FOREIGN TABLE since the term is + * close to a regular table and can confuse the user. + */ + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("cannot create index on foreign table \"%s\"", + heapRelation->relname))); + else + ereport(ERROR, + (errcode(ERRCODE_WRONG_OBJECT_TYPE), + errmsg("\"%s\" is not a table", + heapRelation->relname))); + } /* * Don't try to CREATE INDEX on temp tables of other backends. |
