Open erry-takumi opened 1 year ago
Sorry for the delay. At first glance, this looks like a bug.
It should be looking at both base tables but it appears its only looking at user
Bear with me and I'll investigate this in more detail.
How did this issue turn out? I'm experiencing a similar issue in my environment.
PGSync version:
2.5.0 and also main
Postgres version: 13.8
Elasticsearch version:
6.8.18
Redis version: 6.2.4/alpine
Python version: 3.8.13
Problem Description:
(I'm on mac but running postgres, redis, & ES on linux docker machine). Python is running locally on mac.
TL;DR: I have a table with pkey named employee_id which has a foreign key user_id which references "user".id. I have made a materialized view which joins both tables. When I change anything (e.g. the full_name) in the 'user' table, I get an error: 2023-02-22 17:12:01.881:ERROR:pgsync.sync: Primary keys ['employee_id'] not subset of payload data dict_keys(['id']) for table public.employee_view
Long details follow:
The tables:
The materialized view:
NOT WORKING SCHEMA (with materialized view):
SIMILAR SCHEMA WITH PLAIN TABLES THAT WORKS FINE:
Upon attaching a debugger, I found the following:
node.model
refers to the User table, which I edited, which has the 'id' field. This is what I expect.node.model
refers to theemployee_view
Materialized View, which of course has the field employee_id and user_id, but not 'id'.Let me know if I'm configuring this incorrectly or something as well!
Error Message (if any):