(Home >> Databases >> PostgreSQL Databases)

Overview

This interface allows you to create, manage, and delete PostgreSQL databases and database users.

  • To perform these functions, some cPanel users may prefer to use the streamlined PostgreSQL Database Wizard interface (Home >> Databases >> PostgreSQL Database Wizard).
  • The maximum length of a database name is 63 characters. If you enable database prefixing, this length includes the database prefix and underscore character ( _ ).
  • To enter information in a database, use the phpMyAdmin interface (Home >> Databases >> phpMyAdmin). 

Create a database

To create the database, perform the following steps:

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

  2. Click Create Database.
  3. Click Go Back. The new database will appear in the Current Databases table.

Some versions of PostgreSQL are ANSI SQL-92 compliant and do not support recursive grants, wildcard grants, or future grants. To allow multiple users to access your PostgreSQL tables, click Synchronize Grants after you add a table.

Add a PostgreSQL user

After you create the database, add users to the database and configure their privileges.

You must create PostgreSQL user accounts separately from mail and web administrator accounts.

To create a new user account, perform the following steps:

  1. Enter a username in the Username text box.

  2.  The password must contain at least five characters.

  3. Click Create User.

Current Databases

This table contains a list of PostgreSQL databases on your server.

For each database, the table displays the following information:

Search databases

To search for a specific database in the Current Databases table, enter your criteria in the Search text box and click Go. The table will display the search results.

Rename a database

  • If you rename a database, the system will terminate 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.

To rename a database, perform the following steps:

  1. In the Current Databases table, click the Rename icon in the row that corresponds to the database that you wish to rename.

  2. Enter the new database name in the New Database Name text box.
  3. Click Proceed.

Remove a user from a database

To remove a user from a database, perform the following steps:

  1. In the Current Databases table, click next to the user that you want to delete.
  2. If you are sure that you want to remove the user’s privileges to manage the database, click Yes.

Delete a database

To delete a database, perform the following steps:

  1. In the Current Databases table, click the Delete icon in the Actions column that corresponds to the database that you wish to delete.
  2. If you are certain that you want to permanently delete the database, click Yes.

Define a user's privileges

Privileges define how the user interacts with the database. For example, they determine whether the user can add and delete information.

To define a user’s privileges, perform the following steps:

  1. Under the Add User to Database section of the interface, select a user from the User menu.
  2. From the Database menu, select the database to which you wish to allow the user access.
  3. Click Submit.

Current Users

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

 

Change a PostgreSQL user's password

To change a PostgreSQL user's password, perform the following steps:

  1. In the Current Users table, click the Set Password icon in the Actions column that corresponds to the user that you wish to change.
  2.  The password must contain at least five characters.

  3. Click Change Password.

Change a PostgreSQL user's name

To change a PostgreSQL user's username, perform the following steps:

  1. Click the Rename icon in the Actions column for the user who you wish to rename.
  2. Enter the new username for the account in the New Username text box.

  3. Click Change Username.
If you rename a PostgreSQL user, the Change Password interface will automatically appear to allow you to reset the password for the database user. The md5 hash that PostgreSQL creates to store user passwords requires this step.

Delete a PostgreSQL user

To delete a PostgreSQL user account, perform the following steps:

  1. In the Current Users table, click the Delete icon in the Actions column that corresponds to the user that you wish to delete.
  2. If you are sure you want to permanently delete the account, click Remove user.