A table may be safely re-named by passing the RENAME clause to the ALTER TABLE command. The following is the syntax to re-name a table where table_name is the name of the table to be renamed, and new_table_name is the desired new name for the table:

ALTER TABLE table_name
      RENAME TO new_table_name

A table may be arbitrarily re-named as many times as you like without affecting the data. This may of course be a dangerous thing to do if you are dealing with a table which an external application relies on.

Example 4-9. Re-naming a Table

booktown=# ALTER TABLE books RENAME TO literature;
ALTER
booktown=# ALTER TABLE literature RENAME TO books;
ALTER