Establishing a Connection
The objects available within our connector are accessible from the "cdata.greenplum" module. To use the module's objects directly:
- Import the module as follows:
import cdata.greenplum as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("User=user;Password=admin;Database=dbname;Server=127.0.0.1;Port=5432")
Connecting to Greenplum
To connect to Greenplum, set the Server, Port (the default port is 5432), and Database connection properties and set the User and Password you want to use to authenticate to the server. If the Database property is not specified, the connector connects to the user's default database (it is the same name as the user).
Authenticating to Greenplum
The CData Python Connector for Greenplum supports the md5, password, Kerberos and SASL (particulary, SCRAM-SHA-256) authentication methods.The specific authentication method is setup in the pg_hba.conf file on the Greenplum Server. You can find instructions about authentication setup on the Greenplum Server here. The md5, password and SASL authentication methods do not require additional setup by the CData Python Connector for Greenplum.
Kerberos
The Greenplum Server initiates authentication with the Kerberos Server when the CData Python Connector for Greenplum attempts a connection. You need to setup Kerberos on the Greenplum Server to activate this authentication method. After you have Kerberos authentication setup on the Greenplum Server, see Using Kerberos for details on how to authenticate with Kerberos by the connector.