To connect Amazon Redshift, I used the python psycopg2
module to inject the dataset on Amazon Redshift and it is working fine. Just to mention that I'm using the Redshift's endpoint URL to connect via the psycopg2
which underneath uses python DB API v2.0. Amazon Redshift also provides the JDBC or ODBC URL to connect but I'm not using this.
pseudo-code:
import psycopg2
try:
connection = psycopg2.connect(user = "redshift_user",
password = "redshift_password",
host = "redshift_endpoint",
port = "5432",
database = "redshift_database")
cursor = connection.cursor()
Note: I also use the same endpoint of Redshift to connect it from my different clients like Tableau, Navicat Premium or other SQL clients that use JDBC/ODBC driver underneath it.
But recently Amazon sent me to message about JDBC driver update,
AWS Redshift identified an issue in Redshift JDBC drivers that led to unexpected server restarts, which was subsequently fixed in the latest Redshift JDBC drivers. Some of your clusters in the US-WEST-2 Region are registering connections from older versions of the JDBC driver and might be affected by this issue.
Please upgrade your driver to the latest version: 1.2.36.1060, which is available for download [1].
[1] https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html#download-jdbc-driver
So now I have a couple of question-
The psycopyg2 module is using the JDBC or ODBC driver underneath it?
The above message from AWS is because of the different clients I used that underneath is using the older version of JDBC or ODBC drivers. So I've to update the drivers of my clients only not on my
psycopg2
module.