postgresql-on-google-cloud Google Cloud PostgreSQL Integration with Edilitics

Leveraging PostgreSQL on Google Cloud Platform (GCP) grants you the benefits of a familiar PostgreSQL experience with the added advantages of scalability, high availability, and automated management offered by GCP. This empowers you to migrate existing PostgreSQL workloads or establish new databases with regional deployments for optimal performance. To explore more about Cloud PostgreSQL, visit the official Google Cloud PostgreSQL documentation.

Edilitics integrates seamlessly with your PostgreSQL GCP database, enabling you to unlock valuable insights from your data for informed decision-making. Within the Edilitics platform, PostgreSQL GCP can be used both as a source and destination for data, making it a versatile tool for data analysis workflows.

This step-by-step guide equips you with the knowledge to configure your Google Cloud PostgreSQL instance and integrate it with Edilitics for data analysis.


Before You Begin

  • Make sure you have the following:

    • The IP address or hostname of your PostgreSQL server.

    • PostgreSQL version 9.6 or higher.

    • Whitelisted Edilitics IP addresses:

      • 34.131.133.218

      • 34.93.42.224

    • Database user with SELECT, USAGE, and CONNECT privileges.

  • For Change Data Capture Replication Mode:

    • Log-based incremental replication enabled.

    • The PostgreSQL database instance set as a master instance.

Note: PostgreSQL does not support logical replication for read replicas.


Configuring Google Cloud PostgreSQL for Edilitics

Step 1: Set up Log-based Incremental Replication (Optional)

Note: Skip this step if you are not using logical replication.

PostgreSQL (version 9.6 and above) supports logical replication by writing additional information to its Write Ahead Logs (WALs). To configure logical replication:

  • Log in to Google Cloud SQL to access your database instance.

  • Click the More icon next to the PostgreSQL instance and select Edit.

Google Cloud SQL instance list showing an instance named edilitics-postgresql with details like type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
Google Cloud SQL instance list showing an instance named edilitics-postgresql with details like type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
  • Scroll down to the Flags section.
Google Cloud SQL instance edit screen for edilitics-postgresql, displaying options for data protection, maintenance, flags, query insights, labels, and a summary of instance details.
Google Cloud SQL instance edit screen for edilitics-postgresql, displaying options for data protection, maintenance, flags, query insights, labels, and a summary of instance details.
  • Click the drop-down next to Flags and select Add a Database Flag.
Google Cloud SQL edit screen for edilitics-postgresql showing the maintenance and flags sections, with an option to add a new database flag.
Google Cloud SQL edit screen for edilitics-postgresql showing the maintenance and flags sections, with an option to add a new database flag.
  • In the New database flag dialog, type the flag name in the filter bar.
Google Cloud SQL edit screen for edilitics-postgresql with the option to filter and add a new database flag named cloudsql.enable_pglogical.
Google Cloud SQL edit screen for edilitics-postgresql with the option to filter and add a new database flag named cloudsql.enable_pglogical.
  • Select the flag and assign the appropriate value:

    • cloudsql.enable_pglogical: On

      • This enables the pglogical extension, allowing logical replication capabilities.
    • cloudsql.logical_decoding: On

      • Activates logical decoding for capturing row-level changes in the database.
    • max_replication_slots: 10

      • Specifies the maximum number of replication clients that can connect to the server.
    • max_wal_senders: 10

      • Sets the maximum number of processes that can send WAL logs to replication clients simultaneously.
    • wal_sender_timeout: 0

      • Ensures that replication connections are never terminated due to inactivity.
  • Click Done after adding each flag.

Google Cloud SQL edit screen for edilitics-postgresql with multiple flags including cloudsql.enable_pglogical, cloudsql.logical_decoding, max_replication_slots, max_wal_senders, and wal_sender_timeout.
Google Cloud SQL edit screen for edilitics-postgresql with multiple flags including cloudsql.enable_pglogical, cloudsql.logical_decoding, max_replication_slots, max_wal_senders, and wal_sender_timeout.
Google Cloud SQL edit screen for edilitics-postgresql with the 'Save' and 'Cancel' buttons and multiple flags configured.
Google Cloud SQL edit screen for edilitics-postgresql with the 'Save' and 'Cancel' buttons and multiple flags configured.
  • Add all required flags and click Save and Restart. Once restarted, you can view the configured settings under the Flags section.
Google Cloud SQL edit screen for edilitics-postgresql showing a confirmation dialog that changes require a restart with options to save and restart or cancel.
Google Cloud SQL edit screen for edilitics-postgresql showing a confirmation dialog that changes require a restart with options to save and restart or cancel.
  • Once the instance restarts, you can view the configured settings under the Flags section.
Google Cloud SQL edit screen for edilitics-postgresql showing configured flags and the option to add more database flags, with the 'Save' button highlighted.
Google Cloud SQL edit screen for edilitics-postgresql showing configured flags and the option to add more database flags, with the 'Save' button highlighted.

Step 2: Whitelist Edilitics’ IP Addresses

To establish a connection, whitelist Edilitics IP addresses for your Google Cloud PostgreSQL instance:

  • Access the Google Cloud SQL Instances page and select the desired instance ID.
Google Cloud SQL instance list showing edilitics-postgresql instance details including type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
Google Cloud SQL instance list showing edilitics-postgresql instance details including type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
  • In the left navigation pane, select Connections.

  • Navigate to the Networking tab and scroll to the Authorized networks section.

Google Cloud SQL connections tab for edilitics-postgresql showing networking options, instance IP assignment, and authorized networks.
Google Cloud SQL connections tab for edilitics-postgresql showing networking options, instance IP assignment, and authorized networks.
  • Add the following networks:

    • Name: Edilitics_1

    • Network: 34.131.133.218

    • Name: Edilitics_2

    • Network: 34.93.42.224

  • Save the configuration.

Google Cloud SQL connections tab for edilitics-postgresql with authorized networks listed and an option to add a network, with the 'Save' button highlighted.
Google Cloud SQL connections tab for edilitics-postgresql with authorized networks listed and an option to add a network, with the 'Save' button highlighted.

Step 3: Create a Database User and Grant Privileges

PostgreSQL allows connecting to Edilitics using an existing user or a newly created one. Choose one of the following options:

  • Option 1: Configuring the User Account Using Google Cloud Console

    • Select your primary Google Cloud PostgreSQL instance.
    Google Cloud SQL instance list showing edilitics-postgresql instance details including type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
    Google Cloud SQL instance list showing edilitics-postgresql instance details including type PostgreSQL 9.6, public IP address, high availability enabled, and location us-central1.
    • In the left navigation pane, select Users, and click + Add User Account.
    Google Cloud SQL users tab for edilitics-postgresql showing a list of user accounts with an option to add a user account.
    Google Cloud SQL users tab for edilitics-postgresql showing a list of user accounts with an option to add a user account.
    • Choose an authentication method and ensure a strong password is set.

    • Click Add to finalize.

    Google Cloud SQL user account creation screen for edilitics-postgresql with options to choose authentication method and fields to enter username and password.
    Google Cloud SQL user account creation screen for edilitics-postgresql with options to choose authentication method and fields to enter username and password.
  • Option 2: Create a Replication User and Grant Privileges

    While using logical replication, the user must have the cloudsqlsuperuser role. To configure:

    • Connect to your PostgreSQL database instance as a super admin using a SQL client.

    • Run the following commands:


    CREATE USER <database_username> WITH REPLICATION
    IN ROLE cloudsqlsuperuser LOGIN PASSWORD '<password>';

    Alternatively, update an existing user:


    ALTER USER <existing_user> WITH REPLICATION;

    • Grant privileges:

    GRANT CONNECT ON DATABASE <database_name> TO <database_username>;
    GRANT USAGE ON SCHEMA <schema_name> TO <database_username>;
    GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO <database_username>;
    ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES TO <database_username>;

    Note: Replace placeholder values as necessary.


Connecting Google Cloud PostgreSQL to Edilitics

Step 4: Add the PostgreSQL GCP Connector in Edilitics

  • Navigate to the Integrations module in Edilitics and click New Integration.
Edilitics interface showing the 'New Integration' button and no integrations yet message on a light theme.
Edilitics interface showing the 'New Integration' button and no integrations yet message on a light theme.
  • Select the PostgreSQL GCP connector from the list or use the search bar.
Edilitics integration setup screen showing PostgreSQL and PostgreSQL GCP options on a light theme.
Edilitics integration setup screen showing PostgreSQL and PostgreSQL GCP options on a light theme.

Step 5: Configure the PostgreSQL GCP Connection

Enter the following details on the setup screen:

Field NameDetails
Integration TitleUnique name to identify the integration in Edilitics.
Integration DescriptionBrief description of the data you're integrating.
Database NameThe specific database name in your PostgreSQL instance.
HostThe hostname or IP address of your PostgreSQL server.
PortThe port number used by your PostgreSQL server (usually 5432).
UsernameUser account with appropriate permissions (configured in Step 3).
PasswordPassword for the user account.

Alternatively, use a connection string:


postgresql://<username>:<password>@<host>:<port>/<database_name>


Step 6: Test the Connection

Once credentials are entered, click Test Connection. If successful, you'll see a confirmation message. Otherwise, Edilitics provides troubleshooting details.

Edilitics integration setup screen for PostgreSQL GCP showing fields to enter integration details, including integration name, description, database name, host, port, username, and password, with a 'Test Connection' button on a light theme.
Edilitics integration setup screen for PostgreSQL GCP showing fields to enter integration details, including integration name, description, database name, host, port, username, and password, with a 'Test Connection' button on a light theme.

Step 7: Verify & Finalize Integration

  • Preview (Optional): Confirm accuracy by retrieving a sample of tables and data.

  • Update (Optional): Adjust connection details if data retrieval is inaccurate.

  • Save: Finalize the setup by encrypting and storing connection details in Edilitics.

Need Assistance? Edilitics Support is Here for You!

Our dedicated support team is ready to assist you. If you have any questions or need help using Edilitics, please don't hesitate to contact us at support@edilitics.com. We're committed to ensuring your success!

Don't just manage data, unlock its potential.

Choose Edilitics and gain a powerful advantage in today's data-driven world.