Google Cloud SQL - PostgreSQL Deployment with pgAdmin 4

May 02, 2023

pgAdmin 4 has added functionality to deploy cloud instances for PostgreSQL on AWS, Azure and BigAnimal. pgAdmin version 7.0  has introduced the new functionality for deploying a Google Cloud SQL PostgreSQL instance from pgAdmin. To launch a Google Cloud SQL PostgreSQL instance, the prerequisite is to create and download a client secret file containing the client ID, client secret, and other OAuth 2.0 parameters for google authentication. This feature enables you to quickly deploy the PostgreSQL instance to the desired region on Google Cloud, with custom configuration, and connect to it with pgAdmin.

Creating client secrets 

  1. Go to the Google Cloud Platform Console.
  2. From the projects list, select a project or create a new one.
  3. If the APIs & services page isn't already open, open the console left side menu and select APIs & services.
  4. On the left, click Credentials.
  5. Click Create Credentials, then select OAuth client ID.

  1. If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen
  2. Click Create client ID.
  3. Download client secret by clicking the download button.


 

Deploying Google Cloud SQL PostgreSQL Instance 

To deploy the PostgreSQL server on the Google Cloud SQL, open ‘Deploy Cloud Instance..’ from the server group's Register contextual menu or select a server group from the object menu and navigate to Register > Deploy Cloud Instance… option.

On the Deploy Cloud Instance wizard, select the Google Cloud SQL cloud provider and move to the next step. 

The Credentials step requires a client secret file to initiate google authentication. Select  client secret json file downloaded previously & click on button to authenticate yourself to Google. Clicking the button will open a popup to enter Google credentials.

                                     

Enter the Google credentials and complete the authentication. On s uccessful authentication, the popup will be closed automatically. Move to the next step.