My goal is to read data from Cloud SQL Postgres to BigQuery via a Cloud Data Fusion pipeline.
For this, I set up a Cloud Data Fusion instance and assigned the following two permissions to the service account: (see https://cloud.google.com/data-fusion/docs/how-to/create-instance#setting_up_permissions)
- Cloud SQL Client
- Cloud Data Fusion API Service Agent
As a next step I connected myself to the Cloud Data Fusion Instance, and navigated to Wrangler -> Add Connection -> Database -> Google Cloud SQL for PostgreSQL
.
As the driver I uploaded the postgres-socket-factory-1.0.13-jar-with-dependencies.jar
which I downloaded here: https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
For the driver configuration, I set:
- Name: cloudsql-postgresql
- Class name: org.postgresql.Driver
For the database connection, I set:
- Connection name:
<PROJECT_NAME>:<REGION>:<INSTANCE_CONNECTION_NAME>
- Connection string:
jdbc:postgresql://google/<DATABASE_NAME>?cloudSqlInstance=<INSTANCE_CONNECTION_NAME>&socketFactory=com.google.cloud.sql.postgres.SocketFactory
- Username: Database username
- Password: Database password
After clicking on Test Connection, I receive the org.postgresql.Driver error message.