6

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-

  1. The psycopyg2 module is using the JDBC or ODBC driver underneath it?

  2. 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.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103
  • JDBC is the Java DataBase Connectivity API, and ODBC is the Open DataBase Connectivity API. There is no such thing as JDBC/ODBC (except as a - now removed - JDBC driver in Java that bridged to an ODBC driver). – Mark Rotteveel Oct 30 '19 at 17:16
  • @MarkRotteveel know it, sir, thanks for the reply, but my confusion now is may I need to update my SQL client's JDBC driver? or Python's psycopg2 module to avoid the AWS warning? also JDBC/ODBC I mean JDBC **or** ODBC – A l w a y s S u n n y Oct 30 '19 at 17:19
  • 2
    I have never used psycopg2, but according to https://github.com/psycopg/psycopg2#psycopg2---python-postgresql-database-adapter it wraps libpq, which is a PostgreSQL native library, so it doesn't use a JDBC driver. – Mark Rotteveel Oct 31 '19 at 06:50
  • 1
    psycopg2 is now psycopg2-binary, rest all remains the same. See if you can updgrade to that and if the issue is still there. – Shailesh Oct 31 '19 at 08:23

0 Answers0