# Data Studio with MotherDuck
> Connect Data Studio, formerly Looker Studio, to MotherDuck using the Postgres endpoint and its built-in PostgreSQL connector.
:::info[Preview]
The Postgres endpoint is in [preview](/about-motherduck/feature-stages/). Features and behavior may change.
:::

[Data Studio](https://datastudio.google.com/) (formerly Looker Studio) connects to MotherDuck through the [Postgres endpoint](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/) using Google's built-in PostgreSQL connector. This is a different product from [Looker](./looker-core.mdx), which uses a different connector and its own setup.

## Before you start

You'll need:

- A [Data Studio](https://datastudio.google.com/) account
- A [MotherDuck access token](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck). A [read scaling token](/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling/) is recommended for reporting workloads
- Your Postgres host, which you can find at [MotherDuck Postgres settings](https://app.motherduck.com/settings/postgres) (for example, `pg.us-east-1-aws.motherduck.com`)
- The [ISRG Root X1](https://letsencrypt.org/certs/isrgrootx1.pem) certificate, saved locally. The Postgres endpoint only accepts encrypted connections, and Data Studio needs the certificate to verify the server

## Connect to MotherDuck

1. Go to [Data Studio](https://datastudio.google.com/datasources/create) and select the **PostgreSQL** connector.

   ![Data Studio connector gallery with the Google PostgreSQL connector selected](/img/integrations/data-studio-connector.png)

2. On the **BASIC** tab, fill in the connection details, check **Enable SSL**, and upload the [ISRG Root X1](https://letsencrypt.org/certs/isrgrootx1.pem) certificate as the **Server certificate**. Leave **Enable client authentication** unchecked.

   ![Data Studio PostgreSQL connection form with host, port, database, username, password, SSL enabled, and a server certificate uploaded](/img/integrations/data-studio-connection.png)

3. Click **Authenticate**, then select a table or write a custom query. See [Query your data](#query-your-data) below.

4. Click **Connect**. Data Studio lists the fields in your data source.

   ![Data Studio data source view listing the dimensions and metrics from a MotherDuck table](/img/integrations/data-studio-fields.png)

5. Click **Create Report** to build charts from your MotherDuck data.

   ![Data Studio report with a pie chart, bar chart, time series, and scorecard built from MotherDuck data](/img/integrations/data-studio-report.png)

## Connection parameters

| Parameter | Value |
|-----------|-------|
| **Host Name or IP** | `pg.<region>-aws.motherduck.com` (find yours at [Postgres settings](https://app.motherduck.com/settings/postgres) or with [`md_user_info()`](/sql-reference/motherduck-sql-reference/md-user-info)) |
| **Port** | `5432` (find yours at [Postgres settings](https://app.motherduck.com/settings/postgres)) |
| **Database** | Your database name |
| **Username** | `postgres` |
| **Password** | Your [MotherDuck access token](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck) |
| **Enable SSL** | Checked, with [ISRG Root X1](https://letsencrypt.org/certs/isrgrootx1.pem) as the server certificate |
| **Enable client authentication** | Unchecked |

## Query your data

Data Studio's **TABLES** list is populated from a schema named `public`. MotherDuck creates tables in the `main` schema, so the list is empty unless a `public` schema exists in your database. Choose one of the two approaches below.

### Use a custom query

Select **CUSTOM QUERY** and write a query using the fully qualified table name:

```sql
SELECT * FROM my_db.main.events
```

Each data source is backed by one query. Use this when you want to shape the data in SQL, or to join across schemas and databases.

### Browse tables from the table list

To use the **TABLES** list instead, create a view in a `public` schema for each table you want to browse:

```sql
CREATE SCHEMA IF NOT EXISTS public;
CREATE VIEW public.events AS SELECT * FROM main.events;
```

Give the view the same name as the table it selects from. Data Studio reads the field list from `public.events`, but the queries it generates for charts are unqualified, so they resolve against `main`. If the names differ, charts fail with `Catalog Error: Table with name <name> does not exist`.

## Troubleshooting

| Symptom | Resolution |
|---|---|
| `There are no tables available in this database` | Expected when your database has no `public` schema. Use a [custom query](#use-a-custom-query), or [create views in a `public` schema](#browse-tables-from-the-table-list). |
| Charts fail with `Catalog Error: Table with name <name> does not exist` | The view in `public` has a different name from the table in `main`. Recreate it with matching names. |
| Connecting takes a long time, or the table list does not load | Check **Enable SSL** and upload the [ISRG Root X1](https://letsencrypt.org/certs/isrgrootx1.pem) certificate. The Postgres endpoint only accepts encrypted connections. |
| The field list is stale after changing a table | Click **REFRESH FIELDS** on the data source, or create a new data source. |

## Additional information

- [Postgres endpoint reference](/sql-reference/postgres-endpoint) for connection parameters, SSL options, and limitations
- [Connect through the Postgres endpoint](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/) for a general how-to guide
- [Looker with MotherDuck](./looker-core.mdx) for the other Looker product
- [Data Studio documentation: PostgreSQL connector](https://docs.cloud.google.com/data-studio/connect-to-postgresql)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fintegrations%2Fbi-tools%2Flooker%2Fdata-studio%2F&page_title=Data%20Studio%20with%20MotherDuck&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
