How to connect to external postgres(external DB)

How to connect to external postgres(external DB)

1. From the postgres installed path navigate to bin folder and open a command prompt





















2. Execute the command --> pg_ctl -D "C:\Program Files\PostgreSQL\10\data" start (Postgres server gets started)
3. Connect to DB using the command-->psql -U postgres -h 127.0.0.1 -p 5432(update the postgres port number)
4. Create a database in external server using command-->CREATE DATABASE databasename;
5.Connect to the database-->\c databasename(database gets connected)
6.Create the extensions using the below queries

CREATE EXTENSION IF NOT EXISTS "pg_stat_statements";
 CREATE EXTENSION IF NOT EXISTS "pg_trgm";

7. Execute below command in command prompt  and ensure whether pg_stat_statements and pg_trgm extensions are listed in the output.
 \dx
8. From product installed path modify the StartDBServer parameter as false on customer-config.xml file present in the conf folder to connect external PostgreSQL.
9.Use changeDBServer.bat and connect to postgres as superuser. (Username: Postgres and Password: <Super User Password>).
10.Start the application.

                  New to ADSelfService Plus?

                    • Related Articles

                    • How to Connect External Postgres

                      To install an external PostgreSQL server, ensure the PostgreSQL version matches the inbuilt PostgreSQL version series of the ServiceDesk Plus application. For example: If ServiceDesk Plus version is 14010 with PostgreSQL version 10.21, install an ...
                    • How to resolve Connectivity issues with Postgresql Database from our product?

                      Log Traces Feb 20, 2024 6:40:00 PM [SYSERR] [INFO] : java.sql.SQLException: java.lang.Exception: Exception during getConnection from pool Exception occurred during get connection from datasource Nov 15, 2023 1:29:10 PM [SYSERR] [INFO] : Caused by: ...
                    • How to Connect to SDP MSP Database ?

                      1. In-Built POSTGRES (PGSQL) : Open a CMD prompt as an administrator and navigate to ManageEngine\ServiceDeskPlus-MSP\pgsql\bin and run the below command From SDP MSP build 10538 , please use the below method. psql -h localhost -U sdpadmin -p 65432 ...
                    • How to connect to the AssetExplorer database?

                      To find the database connected to your installation, open Command Prompt with elevated permission, navigate to [AE-Home]\bin directory and invoke the batch file 'changeDBServer.bat'. [AE-Home] is Drive:\ManageEngine\AssetExplorer\ directory. ...
                    • How to connect to the ServiceDesk database?

                      Open command prompt on the server and change the directory to MangeEngine\ServiceDesk\bin, invoke the batch file 'changeDBServer.bat' For MSSQL database  Connect to the query analyzer of the SQL server and execute the queries. For PostgreSQL database ...