Problem Description:
I created schem with table and view, which sum data group by foreign key (primary key of table mentioned before). The problem is, that when I edit table, everythings updates, but if I edit table that the view is based ofn nothing updates. I found example with views in project. After adding base_tables I can see that the trigger has sent data but I have an error. I think the problem is I dont have id in view, but in this case I cant add id.
create view reservation_view(user_id, amount_reserved) as
SELECT reservation.user_id,
sum(reservation.amount) AS amount_reserved
FROM reservation
GROUP BY reservation.user_id;
Table reservation:
id uuid default uuid_generate_v4() not null
primary key,
user_id uuid not null,
amount integer not null,
Any ideas?
Error Message (if any):
2024-05-07 16:37:41.981:ERROR:pgsync.sync: Primary keys ['user_id'] not subset of payload data dict_keys(['id']) for table public.reservation_view
NoneType: None
PGSync version: 3.1.0
Postgres version: 12
Elasticsearch/OpenSearch version: 8.13.2
Redis version: 7.2.4
Python version: 3.10
Problem Description: I created schem with table and view, which sum data group by foreign key (primary key of table mentioned before). The problem is, that when I edit table, everythings updates, but if I edit table that the view is based ofn nothing updates. I found example with views in project. After adding
base_tables
I can see that the trigger has sent data but I have an error. I think the problem is I dont have id in view, but in this case I cant add id.Schem:
View:
Table reservation:
Any ideas?
Error Message (if any):