Installing Postgres JDBC Driver

You must install the required Postgres JDBC driver.

Download, extract, and copy the JDBC driver, renamed, to /usr/share/java/. If the target directory does not yet exist, create it.

Installing the Postgres JDBC Driver

  1. To install the matching PostgreSQL driver for your OS, run the applicable command:
    RHEL
    sudo yum install postgresql-jdbc
    Ubuntu
    sudo apt-get install libpostgresql-jdbc-java
    SLES
    sudo zypper install postgresql-jdbc
  2. Add a link to the OS Postgres JDBC driver .jar file to postgresql-connector-java.jar which is the name Cloudera seeks. See the following example for a complete postgresql-jdbc.jar deployment over RHEL9:

root@server1:/home/cdp # yum list postgresql-jdbc
Updating Subscription Management repositories.
Red Hat CodeReady Linux Builder for RHEL 9 x86_64 (RPMs)		130 kB/s | 4.5 kB	00:00
Red Hat Enterprise Linux 9 for x86_64 - AppStream - Extended	135 kB/s | 4.5 kB	00:00
Red Hat CodeReady Linux Builder for RHEL 9 x86_64 - Extended	144 KB/s | 4.5 kB	00:00
EPEL9															117 kB/s | 2.3 kB	00:00
Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)			107 kB/s | 4.1 kB	00:00
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMS)		133 kB/s | 4.5 kB	00:00
Red Hat Enterprise Linux 9 for x86_64 - BaseOS - Extended Upd 	134 kB/s | 4.1 kB	00:00
Available Packages
postgresql-jdoc.noarch			42.2.28-1.e19-3				rhel-9-for-x86_64-appstream-eus-rpms
postgresql-jdbc.noarch			42.2.28-1.e19_3				rhel-9-for-x86_64-appstream-rpms
root@server1:/home/cdp # yum install postgresql-jdbc -y
Updating Subscription Management repositories.
Red Hat CodeReady Linux Builder for RHEL 9 x86_64 (RPMs)		 96 kB/s | 4.5 kB	00:00	
Red Hat Enterprise Linux 9 for x86_64 - AppStream - Extended     59 kB/s | 4.5 kB	00:00
Red Hat CodeReady Linux Builder for RHEL 9 x86_64 - Extended	107 KB/s | 4.5 kB	00:00
EPEL9															 97 kB/s | 2.3 kB	00:00
Red Hat Enterprise Linux 9 for x86_64 - BaseOs (RPMs)    		 97 kB/s | 4.1 kB	00:00       
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMS)        102 kB/s | 4.5 kB	00:00 
Red Hat Enterprise Linux 9 for x86_64 - BaseOS - Extended Upd 	 96 kB/s | 4.1 kB 	00:00
Dependencies resolved.
=================================================================================================
Package					Arch	Version				Repository								Size
=================================================================================================
Installing:
postgresql-jdbc			noarch	42.2.28-1.e19_3		rhel-9-for-x86_64-appstream-eus-rpms	794	k
Installing dependencies:
 ongres-scram			noarch	1.9-betal-1.el9		rhel-9-for-x86_64-appstream-eus-rpms	75	k
 ongres-scram-client	noarch	1.9-betal-1.e19		rhel-9-for-x86_64-appstream-eus-rpms	26  k

Transaction Summary
=================================================================================================
Install 3 Packages

Total download size: 895 k
Installed size: 957 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): ongres-scram-1.9-betal-1.el9.noarch.rpm					 55 kB/s |  75 kB	00:01
(2/3): ongres-scram-client-1.9-betal-1.el9.noarch.rpm			 18 kB/s |  26 kB	00:01
(3/3): postgresql-jdoc-42.2.28-1.e19_3.noarch.rpm				544 kB/s | 794 kB	00:01
-------------------------------------------------------------------------------------------------
Total															609 kB/s | 895 kB	00:01

Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing			:																		1/1
  Installing		: ongres-scram-1.9-betal-1.e19.noarch									1/3
  Installing		: ongres-scram-client-1.9-betal-1.e19.noarch							2/3
  Installing		: postgresgl-jdoc-42.2.28-1.e19 3.noarch								3/3
  Verifying			: postgresql-jdbc-42.2.28-1.el9_3.noarch								1/3
  Verifying			: ongres-scram-client-1.9-betal-1.e19.noarch							2/3
  Verifying			: ongres-scram-1.9-betal-1.el9.noarch									3/3
Installed products updated.

Installed:
  ongres-scram-1.9-betal-1.el9.noarch			ongres-scram-client-1.9-betal-1.el9.noarch
  postgresq1-jdbc-42.2.28-1.e19_3.noarch

Complete!
root@server1:/home/cdp # ls -l /usr/share/java
total 4396
drwxr-xr-x 2 root root		42 Nov 2 09:10 ongres-scram
-rw-r--r-- 1 root root 4498228 Dec 1  2024 oracle-connector-java.jar
lrwxrwxrwx 1 root root 		30 Mar 6  2024 postgresql.jar -> postgresql-jdbc/postgresql.jar
drwxr-xr-x 2 root root		28 Nov 2 09:10 postgresql-jdbc
lrwxrwxrwx 1 root root		30 Mar 6  2024 postgresql-jdbc.jar -> postgresql-jdbc/postgresql.jar
root@server1:/home/cdp # ln -s /usr/share/java/postgresql-jdbc.jar /usr/share/java/postgresql-connector-java.jar
root@server1:/home/cdp # ls -l /usr/share/java/
total 4396
drwxr-xr-x 2 root root		42 Nov 2 09:10 ongres-scram
-rw-r--r-- 1 root root 4498228 Dec 1  2024 oracle-connector-java.jar
lrwxrwxrwx 1 root root		35 Nov 2 09:20 postgresql-connector-java.jar -> /usr/share/java/postgresql-jdbc.jar
lrwxrwxrwx 1 root root		30 Mar 6  2024 postgresql-jar -> postgresgl-jdbc/postgresql.jar
drwxr-xr-x 2 root root		28 Nov 2 09:10 postgresql-jdbc
lrwxrwxrwx 1 root root		30 Mar 6  2024 postgresql-jdbc.jar -> postgresql-jdbc/postgresql.jar
root@server1:/home/cdp # ls -lL /usr/share/java
total 6892
drwxr-xr-x 2 root root		42 Nov 2 09:10 ongres-scram
-rw-r--r-- 1 root root 4498228 Dec 1  2024 oracle-connector-java.jar
lrwxrwxrwx 1 root root	850044 Mar 6  2024 postgresql-connector-java.jar
lrwxrwxrwx 1 root root	850044 Mar 6  2024 postgresql-jar
drwxr-xr-x 2 root root		28 Nov 2 09:10 postgresql-jdbc
lrwxrwxrwx 1 root root	850044 Mar 6  2024 postgresql-jdbc.jar
root@server1:/home/cdp #