PostHog / PostHog/posthog

Multi-Schema Postgres DB

Open
#58,643 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

Yes

Please describe.

The postgres connection in PostHog (Sync to Warehouse) currently allows one schema per connection. If a postgres DB has multiple schemas, users have to set up a separate connection in PostHog for each schema. Our database is designed to have one schema for each of our clients and we have 1000+ schemas in our database. It is super manual and not scalable to create 1000+ connections in PostHog to bring data from all the schemas.

Describe the solution you'd like

The Ideal solution: the Postgres connnection in PostHog allows users to select all the schemas or multiple schemas. Once the connection is set up, users can query data from any or all schemas inside PostHog.

It would be great if there is an automated way to consolidate (union all) tables from all schemas into master tables

Describe alternatives you've considered

Airbyte + Snowflake + dbt to consolidate (union all) tables from all schemas into master tables and then bringing those master tables into PostHog. But this creates additonal steps, layers and costs

Additional context

Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by tracing the Postgres Sync to Warehouse connection flow and its schema-selection behavior. Done means users can select multiple or all schemas and query their data without creating one connection per schema; any consolidation behavior should also be defined and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.