Skip to content

Instantly share code, notes, and snippets.

@thmsobrmlr
Created November 8, 2023 11:53
Show Gist options
  • Save thmsobrmlr/a152db78c1ae81f147c02415d8d4b981 to your computer and use it in GitHub Desktop.
Save thmsobrmlr/a152db78c1ae81f147c02415d8d4b981 to your computer and use it in GitHub Desktop.
Can we use the CH PostgreSQL table engine to query posthog_persondistinctids?
DROP TABLE default.poc_pg_persondistinctid;
CREATE TABLE default.poc_pg_persondistinctid
(
id UInt32,
distinct_id String,
version UInt64,
person_id UInt32,
team_id UInt32
)
ENGINE = PostgreSQL('db:5432', 'posthog', 'posthog_persondistinctid', 'posthog', 'posthog');
SELECT * FROM poc_pg_persondistinctid LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment