Home > Help Center > Shared Hosting > Databases > Manage PostgreSQL Databases in cPanel

Manage PostgreSQL Databases in cPanel

In this article we will show you how to create, manage, and delete PostgreSQL databases and database users.

The maximum length of a database name is 63 characters including the database prefix and underscore character (_).

To enter information in a database, use the phpPgAdmin interface (cPanel > Databases > phpPgAdmin).

Important: You can not create PostgreSQL databases or database users in phpPgAdmin.

To enter PostgreSQL Databases screen go to cPanel > Databases > PostgreSQL Databases:

cpanel postgresql database

Create a PostgreSQL Database

In the Database Name text box, enter a name for the database.

Click Create Database.

cpanel postgresql database

The new database will appear in the Current Databases table.

Current Databases

The Current Databases table lists the following information for each database in your account:

cpanel postgresql database

  • Database - the name of the database.
  • Size - the size of the database.
  • Privileged Users - users who can manipulate the database.
  • Actions - click the appropriate icon in this column to Rename or Delete a database:

Remove a user from a database

In the Current Databases table, click the username. On the next screen click Delete User from Database to confirm deletion:

cpanel postgresql database

Rename a database

When you rename a database, the system terminates all active connections to the database.

You must manually update configuration files and applications to use the new database name.

The system requires more time to rename larger and more complex databases.

In the Current Databases table, click Rename in the Actions column next to the database that you wish to rename.

Enter the new database name in the New name text box.

Click Proceed:

cpanel postgresql database

Delete a database

In the Current Databases table, click Delete in the Actions column next to the database that you wish to delete.

To permanently delete the database, click Delete Database:

cpanel postgresql database

Add a PostgreSQL user

After you create the database, add users to the database.

  • You must create a user before you can add the user to an existing database
  • You must create PostgreSQL user accounts separately from mail and web administrator accounts.

Enter a username in the Username text box.

The maximum length of a database username is 63 characters including the database prefix and underscore character (_).

Enter and confirm the new password in the appropriate text boxes. Use Password Generator to generate a strong password. The password must contain at least five characters.

Click Create User.

cpanel postgresql database

Some versions of PostgreSQL are ANSI SQL-92 compliant and do not support recursive grants, wildcard grants, or future grants. To ensure that users continue to have access the information in your PostgreSQL tables, click Synchronize Grants.

We recommend that you synchronize the grants after you take the following actions:

  • Add a new user.
  • Add an existing user to a database.
  • Create a new table manually in phpPGAdmin.

Add a user to a database

Select the appropriate user and the database you want to add the user to from the User and Database menus.

Click Submit:

cpanel postgresql database

Current Users

The Current Users table lists all of your PostgreSQL users. Use the functions in this table to change user passwords and usernames, or to delete users:

cpanel postgresql database

Change a PostgreSQL user's password

In the Current Users table, click Change Password in the Actions column next to the user that you wish to change.

Enter and confirm the new password in the appropriate text boxes. Use Password Generator to generate a strong password. The password must contain at least five characters.

Click Change Password:

cpanel postgresql database

Change a PostgreSQL user's name

Click Rename in the Actions column for the user that you wish to rename.

Enter the new username for the account in the New name text box.

Click Proceed:

cpanel postgresql database

Warning: When you rename a PostgreSQL user, the Change Password interface automatically appears so you can reset the password for the database user. The md5 hash that PostgreSQL creates to store user passwords requires this step.

Delete a PostgreSQL user

Click Delete in the row next to the user that you wish to delete.

To permanently delete the account, click Remove User:

cpanel postgresql database

Conclusion

PostgreSQL Databases interface offers many tools to manage the database and database users. Do not forget that you may use PostgreSQL Database Wizard to create database and user in an easy and error free way.

#cpanel #apps

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support