Renaming A Table
Last updated
Was this helpful?
Last updated
Was this helpful?
Using the alter table
command in PostgreSQL, you can rename an existing table. This command will also update any references to the table such as via foreign key constraints. Just run a command like the following:
Note that this may result in breaking a number of conventions. Foreign keys, sequences, and constraints with names eponymous to the original table will no longer follow convention despite the references being updated. These can be renamed as well if desired.
See for a full example.
See the for more details.