Empowering you to understand your world

PostgreSQL Tutorials: How To Rename A Table

You can rename a table in PostgreSQL by using the ‘ALTER TABLE’ command as follows:

ALTER TABLE tablename RENAME TO preferredtablename;

If the table name has odd characters in it, then a syntax error might be generated which can be solved by placing the table name in double quotes:

ALTER TABLE "table-name" RENAME TO preferredtablename;

Subscribe to our newsletter
Get notified when new content is published