PostgreSQL – Rename Table

Below is the syntax to rename a table in Postgres where tablename is the current name of the table and new_tablename is the new name.

ALTER TABLE tablename RENAME TO new_tablename;

See also  PostgreSQL - Get definition of a materialized view