The following bug has been logged on the website:
Bug reference: 15087
Logged by: Ezequiel Tolnay
Email address: etolnay(at)gmail(dot)com
PostgreSQL version: 10.0
Operating system: Windows 10
Description:
A table name mytable can be renamed to newtable via:
ALTER INDEX mytable RENAME TO newtable
This is probably incorrect. It should either raise an error (as it does with
ALTER TABLE if the name supplied is that of an index), or better, when
specified IF EXISTS, simply do nothing.