This post shows how the PRPC database –assuming PRPC is configured to use PostgreSQL– and its tables can be accessed using the pgAdmin tool. This example applies to the following PRPC installation method:
- PegaRULES Process Commander is installed as a Personal Virtual Server (PVS) utilizing the VMWare Player as described in the Downloading the Exercise System section of the System Architect Essentials I (7.1) and Senior System Architect (7.1) courses provided by Pega Academy.
- For this example, Windows 7 is used as the host operating system. The steps should be similar for other OS.
- Example of FTP Connection to Pega 7 PRPC for Private Virtual Server Installations
- Running Pega 7 Exercise System on Tomcat 9 and PostgreSQL – without VMWare or VirtualBox
- How to Delete Case Type Instances in Pega 7 with an Activity
- Installation of the PostgreSQL pgAdmin Console
- Configuration of PostgreSQL DB Server to Accept Remote Connections
- Configuration of Connection Settings in postgresql.conf File
- Setup of PostgreSQL DB User for pgAdmin Connections
- Configuring the Connection to the Pega 7 DB in pgAdmin
Download the pgAdmin tool for Windows from https://www.pgadmin.org/download/windows.php or for the Mac from https://www.pgadmin.org/download/macosx.php. In this example, pgAdmin version 1.14.3 for Windows was used. Follow the pgAdmin installation instructions to install the application.
- The exercise systems on Pega Academy use the PostgreSQL DB server as part of the PRPC personal virtual server installation.
- Open the VMWare Player and click on the virtual machine and then click on the link Edit virtual machine settings.
- Clicking on Network Adapter opens a view showing the current network connection settings.
- In this example, the Network Adapter under Virtual Machine Settings of the VMWare Player is configured to use NAT (network address translation), so that the host’s IP address is shared (in this case the Windows OS on which the VMWare Player is running).
- This will result in the virtual machine using an IP address in the
192.168private network that is shared with the host operating system.
- Next, use the VMWare Player to start the virtual machine by clicking on the link Play virtual machine and access it through the command line using the default user
architectand the default password
- For newer versions of the Pega Exercise System, use the default user
rootand the password
- The PostgreSQL server instance needs to be configured so that it allows connections from the
192.168private network since pgAdmin has been installed on the host operating system.
- Navigate to the folder
/etc/postgresql/9.1/mainon the virtual machine and locate the file
- Open the file in the vi editor using the command
sudo vi pg_hba.conf
- In the section
# IPv4 local connections, add:
host all all 192.168.0.0/16 md5to allow incoming connections from pgAdmin running on the Windows host operating system.
- Navigate to the folder
/etc/postgresql/9.1/mainand locate the file
postgresql.confand open it in vi using the command:
sudo vi postgresql.conf
- Locate the section
# CONNECTIONS AND AUTHENTICATIONand uncomment the parameter
listen_addressesand set its value to
- In order for the changes to take effect, the virtual machine can either be restarted or the command:
- …can be used to only restart PostgreSQL so that it applies the updated configuration files.
- The PostgreSQL DB server running on the virtual machine will now accept remote connections from any IP address.
- It is recommended to create a dedicated PostgreSQL database user that will be used in the pgAdmin console. Execute the following command to create a new super user with access to all databases:
sudo -u postgres createuser --superuser <username>
- Then open the PostgreSQL command line with by executing the command:
sudo -u postgres psql
- Set the password of the new super user with the psql command:
- The PostgreSQL server port should be 5432. It can be checked by executing the command:
sudo -u postgres psql -c "SHOW port;"
- Obtain the IP address of the virtual server by executing the command:
- In this case, the IP address of the virtual machine is
- Open the pgAdmin application on the Windows host system.
- In pgAdmin, click on File in the top level menu and select Add Server.
- In the New Server Registration dialog, enter the name for the connection, the host name, the port and the username and the password of the super user account created earlier.
- Then click on Ok to open the connection.
- Double clicking on the new server connection opens a tree menu showing the Pega PRPC database named
- pgAdmin can be used to understand how PRPC operates and how it maintains data and rules by looking at the tables in the associated schemas.
Caution: Modifying or deleting data or PRPC system tables can compromise a PRPC instance and render it useless.