This article explains how to rename a PostgreSQL database.
You may need to rename a PostgreSQL database from time to time, such as when you migrate data from one account or hosting provider to another, or during site development.
The steps to rename a PostgreSQL database depend on whether or not your A2 Hosting account includes cPanel access.
If your A2 Hosting account includes cPanel access, you can use cPanel to quickly and easily rename a PostgreSQL database. To do this, follow these steps:
In the Actions column, click Rename:
The Rename Database dialog box appears.
In the New name text box, type the new name for the database:
If your A2 Hosting account does not include cPanel, you can quickly and easily rename a PostgreSQL database from the command line. To do this, follow these steps:
psql dbname username
To rename the database, type the following command. Replace old_dbname with the name of the database that you want to rename, and replace new_dbname with the database's new name:
ALTER DATABASE "old_dbname" RENAME TO "new_dbname"
To verify that the database was renamed, type the following command to list the databases:
\list
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.