Amazon Redshift 的 JDBC 驱动程序与 Python 适配器之间的区别

Alw*_*nny 6 psycopg2 amazon-web-services python-db-api amazon-redshift

为了连接 Amazon Redshift,我使用 pythonpsycopg2模块将数据集注入到 Amazon Redshift 上,并且运行良好。只是提一下,我使用 Redshift 的端点 URL 通过psycopg2下面使用 python DB API v2.0 的连接进行连接。Amazon Redshift 还提供 JDBC 或 ODBC URL 进行连接,但我没有使用它。

伪代码:

import psycopg2
try:
    connection = psycopg2.connect(user = "redshift_user",
                                  password = "redshift_password",
                                  host = "redshift_endpoint",
                                  port = "5432",
                                  database = "redshift_database")

    cursor = connection.cursor()
Run Code Online (Sandbox Code Playgroud)

注意:我还使用 Redshift 的相同端点从不同的客户端(例如 Tableau、Navicat Premium 或在其下使用 JDBC/ODBC 驱动程序的其他 SQL 客户端)连接它。

但最近亚马逊给我发了关于 JDBC 驱动程序更新的消息,

AWS Redshift 发现 Redshift JDBC 驱动程序中存在导致服务器意外重启的问题,该问题随后在最新的 Redshift JDBC 驱动程序中得到修复。US-WEST-2 区域中的一些集群正在注册来自旧版本 JDBC 驱动程序的连接,可能会受到此问题的影响。

请将您的驱动程序升级到最新版本:1.2.36.1060,可供下载[1]。

[1] https://docs.aws.amazon.com/redshift/latest/mgmt/configure-jdbc-connection.html#download-jdbc-driver

所以现在我有几个问题-

  1. psycopyg2 模块使用的是 JDBC 或 ODBC 驱动程序吗?

  2. 来自 AWS 的上述消息是因为我使用的不同客户端使用的是旧版本的 JDBC 或 ODBC 驱动程序。所以我必须只更新我的客户端的驱动程序,而不是我的psycopg2模块上的驱动程序。