This page explains how to explore and manage your AlloyDB for PostgreSQL data using AlloyDB Studio in the Google Cloud console.
AlloyDB Studio includes an Explorerpane that integrates with a query editor and a SQL query results table. You can run DDL, DML, and DQL statements from this single interface. For example, instead of configuring a third-party database query tool, you can create a table or query your data using this query editor.
If you're new to AlloyDB for PostgreSQL, see AlloyDB overview .
You can use the Explorerpane in AlloyDB Studio to view and interact with your database objects. You can create, alter, and delete the following database objects:
- Schemas
- Tables
- Columns
- Indexes and keys
- Triggers
- Views
- Functions
- Procedures
- Sequences
- Types
- Extensions
Required roles and permissions
To use AlloyDB Studio, you need the following permissions:
-
alloydb.clusters.get -
alloydb.databases.list -
alloydb.instances.executeSql -
alloydb.instances.list -
alloydb.users.list
You can get these permissions through the roles/alloydb.admin
role, or using a combination of roles/alloydb.viewer
and roles/alloydb.databaseUser
roles. If you don't have these roles, contact your Organization Administrator to
request access. You might also be able to get the required permissions through custom roles
or other predefined roles
.
Additionally, ensure that you have database-level permissions for the database that you use for authentication.
Authenticate to AlloyDB Studio
Before you can access a database in AlloyDB Studio, you must first select a database authentication method. To sign in to your database using AlloyDB Studio, you can use one of the following types of authentication:
-
IAM database authentication : use IAM authentication to manage the database access and privileges for users in your organization. To use this, set up IAM authentication on the instance.
-
Built-in database authentication : connect to the database in AlloyDB Studio by using your PostgreSQL user account and credentials. For more information, see Manage PostgreSQL users with built-in authentication .
Explore your data
To access the Explorerpane, follow these steps:
-
In the Google Cloud console, open the AlloyDBpage.
-
Select a cluster from the list.
-
In the navigation menu, click AlloyDB Studio.
-
Select a database authentication method .
-
Click Authenticate. The Explorerpane displays a list of the objects in your database.
Create, modify, and query your data
You can use the query editor to run SQL statements. Statements must be separated by a semicolon. Compose a query yourself, or populate the query editor with a template.
Statement execution is based on the order in which you enter them in the query editor.
To create, query, or modify your data, follow these steps:
-
In the Google Cloud console, open the AlloyDBpage.
-
Select a cluster from the list.
-
In the navigation menu, click AlloyDB Studio.
-
Sign in to AlloyDB Studio using the name of your database, username, and password.
-
Compose a query using one of the following methods:
-
To compose your own query, follow these steps:
- Click New SQL editor tabor New tabto open a new tab.
- When the query editor appears, write your query.
-
To compose a query that starts with a template, follow these steps:
- In the Explorerpane, next to a database object, click more_vert View actions. One or more available actions appear.
- Click an action. The query editor populates with a template.
- Replace any placeholders in the template.
-
-
Click Run. This executes all the queries in the query editor. The results of your query appear in the Resultstable.
You can also select and execute one or multiple queries at the same time. To do this, select a query or multiple queries and click Run selected.
Limitations
- AlloyDB Studio supports lightweight queries. Responses over 10MB might be truncated. AlloyDB Studio indicates when it returns partial results.
- Long-running queries or index creations on large tables that exceed five minutes on the instance are timed-out and cancelled.
- AlloyDB Studio doesn't keep a database connection open after execution of a SQL script is complete. Similarly, the Editortabs don't share a common session and every execution starts a new connection using a separate session.
- When you run multiple query statements at the same time, and one of the queries results in an error, then the whole query is cancelled.
What's next
- Learn more about how Gemini can help you write SQL or analyze your data .

