I noticed that ALTER FOREIGN TABLE RENAME TO emits a wrong hint message if the object was not a foreign table. ISTM that the hint message is not necessary there. Attached patch removes the hint message.

Steps to reproduce the situation:

postgres=# CREATE FOREIGN TABLE foo () SERVER file_server;
postgres=# ALTER FOREIGN TABLE foo RENAME TO bar;
ERROR:  "foo" is not a foreign table
HINT:  Use ALTER FOREIGN TABLE instead.

Regards,
--
Shigeru Hanada
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 7660114..09f3f4e 100644
*** a/src/backend/commands/tablecmds.c
--- b/src/backend/commands/tablecmds.c
*************** RenameRelation(Oid myrelid, const char *
*** 2268,2275 ****
                ereport(ERROR,
                                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                                 errmsg("\"%s\" is not a foreign table",
!                                               
RelationGetRelationName(targetrelation)),
!                                errhint("Use ALTER FOREIGN TABLE instead.")));
  
        /*
         * Don't allow ALTER TABLE on composite types. We want people to use 
ALTER
--- 2268,2274 ----
                ereport(ERROR,
                                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                                 errmsg("\"%s\" is not a foreign table",
!                                               
RelationGetRelationName(targetrelation))));
  
        /*
         * Don't allow ALTER TABLE on composite types. We want people to use 
ALTER
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to