Files
supabase/apps/docs/content/guides/storage/analytics/query-with-postgres.mdx
Prashant SridharanandAlan Daniel 14d36e9480 Bolt webinar cta page (#43107)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

New Go landing page for the upcoming Bolt webinar. This is where we will
direct customers who want to learn more to go to request a meeting.

---------

Co-authored-by: Alan Daniel <stylesshjs@gmail.com>
2026-02-24 10:50:54 +00:00

81 lines
2.2 KiB
Plaintext

---
title: 'Query with PostgreSQL'
subtitle: 'Query analytics bucket data directly from PostgreSQL using SQL.'
---
Once your data flows into an analytics bucket—either via the [Replication Pipeline](/docs/guides/storage/analytics/replication) or custom pipelines—you can query it directly from Postgres using standard SQL.
This is made possible by the [Iceberg Foreign Data Wrapper](/docs/guides/database/extensions/wrappers/iceberg), which creates a bridge between your Postgres database and Iceberg tables.
## Setup overview
You have two options to enable querying:
1. **Dashboard UI** (recommended) - Streamlined setup through the Supabase Dashboard
2. **Manual installation** - Install the wrapper using SQL and configuration
## Installing via Dashboard UI
The dashboard provides the easiest setup experience:
1. Navigate to your **Analytics Bucket** page in the Supabase Dashboard.
2. Locate the namespace you want to query and click **Query with Postgres**.
<Image
alt="Query with PostgreSQL button on analytics bucket page"
src="/docs/img/storage/query-analytics-with-postgres.png"
width={1860}
height={332}
/>
3. Enter the **Postgres schema** where you want to create the foreign tables.
<Image
alt="Select destination PostgreSQL schema"
src="/docs/img/storage/query-analytics-schema-name.png"
width={525}
height={297}
/>
4. Click **Connect**. The wrapper is now configured.
## Querying your data
Once the foreign data wrapper is installed, you can query your Iceberg tables using standard SQL:
```sql
select *
from schema_name.table_name
limit 100;
```
### Common query examples
Get the latest events:
```sql
select event_id, event_name, event_timestamp
from analytics.events
order by event_timestamp desc
limit 1000;
```
Join with transactional data:
```sql
SELECT
e.event_id,
e.event_name,
u.user_email
FROM analytics.events e
JOIN public.users u ON e.user_id = u.id
WHERE e.event_timestamp > NOW() - INTERVAL '7 days'
LIMIT 100;
```
## Manual installation
For advanced use cases, you can manually install and configure the Iceberg Foreign Data Wrapper. See the [Iceberg Foreign Data Wrapper documentation](/docs/guides/database/extensions/wrappers/iceberg) for detailed instructions.