Postgresql Rename Table

This is a post on how to rename a table in PostgreSQL from the command line. PostgreSQL is a command line rich database application. It does have GUIs available, but most webmasters find it easier to do most database management tasks from the command line or from the psql command prompt.

Command line command to rename table:

First from a command prompt, type:

psql table_name

You will be given a psql command prompt after using the above command line command. Now enter the following command from the psql command prompt:

ALTER TABLE distributors RENAME TO suppliers;

 

Leave a Reply

Your email address will not be published. Required fields are marked *