Google Cloud SQL for PostgreSQL Setup Guide
Google Cloud SQL for PostgreSQL Setup Guide
Prerequisites
To connect your Google Cloud SQL for PostgreSQL database to Go Fig, you need:
PostgreSQL version 9.6 - 17
Your database's port (usually 5432)
TLS enabled on your database, if you choose to connect directly to Go Fig. Follow Google Cloud's TLS setup instructions to enable TLS on your database.
Setup instructions
1. Set up direct connection with Go Fig
To connect Go Fig directly to your PostgreSQL database on Google Cloud SQL, you must first enable TLS on your database. Follow Google Cloud's TLS setup instructions to enable TLS on your database.
Go to your Google Cloud Platform SQL dashboard.
Click on the name of the database that you want to connect to Go Fig.
> NOTE: If you plan to create a read replica to connect to Go Fig, then edit the primary database you plan to replicate. The primary database's settings will be propagated to the replica.
In the left menu, go to the Connections tab.
Go to the Security tab:
If you see Only secured connections are allowed to connect to this instance, click Allow unsecured connections.
If you see Unsecured connections are allowed to connect to this instance, you do not need to change anything.
2. Create read replica (optional)
If you'd like, create a read replica for Go Fig's exclusive use. Using a read replica allows Go Fig to integrate your data without putting unnecessary load on or interrupting the queries running on your primary server. We recommend that you connect a read replica to Go Fig, but it's not required.
If you already have a read replica or want to connect Go Fig to your primary database, skip ahead to Step 3
Go to your Google Cloud Platform SQL dashboard.
Click on the name of your primary database.

In the left menu, go to the Replicas tab.

Click Create Read Replica.

On the Create read replica page, enter an Instance ID for the replica.

Click Done.
Click Create. It will take a few minutes for the read replica to be created.
3. Enable database access
Grant Go Fig's data processing servers access to your database.
In your Google Cloud Platform SQL dashboard, click on your primary database or read replica.
In the left menu, go to the Connections tab.
In the Connectivity section, click Add network.

In the New network window, create a network for Go Fig. In the Network field, enter our partner Airbyte's IP Addresses for your database's region.

Click Save. It will take a few minutes for the database to be updated with the new settings.
In the left menu, go to the Overview tab.
In the Connect to this instance section, find your database's public IP address and make a note of it. You will need it to configure Go Fig.

4. Create dedicated user
Create a database user for Go Fig's exclusive use.
Open a connection to your PostgreSQL primary database in a PostgreSQL console (such as a SQL workbench or psql).
Create a user for Go Fig by executing the following SQL command. Replace <username> and some-password with a username and password of your choice.
CREATE USER <username> PASSWORD 'some-password';
5. Grant read-only access
Grant the Go Fig user read-only access to all tables by running the following commands. To grant access to a schema other than PostgreSQL's default public schema, replace public with the schema name.
GRANT USAGE ON SCHEMA "public" TO <username>;
GRANT SELECT ON ALL TABLES IN SCHEMA "public" TO <username>;
ALTER DEFAULT PRIVILEGES IN SCHEMA "public" GRANT SELECT ON TABLES TO <username>;
NOTE: The last command makes sure that any future tables will be accessible to Go Fig.
If you want to grant access to multiple schemas, you must run these three commands for each schema.
6. Finish Go Fig configuration
Set the collection name to organize the tables pulled from Postgres from within Go Fig.
In the Host field, enter your database's IP that you found in Step 3 (for example, 1.2.3.4). Alternately, you can also enter your database host's domain (for example, your.server.com).
Enter your database instance's Port number. The port will be 5432, unless you changed the default.
Enter the Go Fig-specific User and Password that you created in Step 4.
Enter the name of your Database (for example, your_database).
List out all the schema(s) you want to sync tables from. If you leave it empty, it will default to public. If you choose to list multiple schemas, they must be separated by commas (for example, public, another_schema).
Updated on: 05/16/2025
Thank you!