With the connector running, let's verify that data flows from PostgreSQL to ClickHouse in real-time.
PostgreSQL
CREATE TABLE test_sync ( id SERIAL PRIMARY KEY, name TEXT, created_at TIMESTAMP DEFAULT NOW() ); INSERT INTO test_sync (name) VALUES ('Hello from PostgreSQL!');
Wait ~5 seconds for the change to propagate
ClickHouse
SELECT * FROM test_sync;
| id | name | created_at |
|---|---|---|
| 1 | Hello from PostgreSQL! | 2024-06-15 10:30:00 |
The row you inserted in PostgreSQL should now appear in ClickHouse. The table was auto-created by the connector (AUTO_CREATE_TABLES=true).
PostgreSQL
-- In PostgreSQL: UPDATE test_sync SET name = 'Updated!' WHERE id = 1;
Wait ~5 seconds
ClickHouse
-- In ClickHouse (after a few seconds): SELECT * FROM test_sync; -- Should show: name = 'Updated!'
| id | name | created_at |
|---|---|---|
| 1 | Updated! | 2024-06-15 10:30:00 |