sraoss / pgsql-ivm

IVM (Incremental View Maintenance) development for PostgreSQL
Other
129 stars 12 forks source link

Fix incorrect results of aggregate views withoug GROUP BY #89

Closed yugo-n closed 4 years ago

yugo-n commented 4 years ago

Views of aggregate without GROUP BY clause always have only one tuple as the result. Even when all tuples in base tables are deleted, the view must have a row whose result is 0 for count(), or NULL for others.

However, in the previous implementation, this resulted in deleting the tuple from the view. To fix this, don't allow to delete a tuple from a view when this is a aggregate view without GROUP BY.

Github issue #88