Commit graph

3 commits

Author SHA1 Message Date
Jason Petersen
fe6a09e5f7 WIP: Allow partitioned tables in IMMVs
This isn't feature-complete yet, but opening as a place to start a con-
versation around how to fully implement this feature.

At the moment, the prohibition on partitioned tables is removed, and
hooks are added to handle ATTACH PARTITION and DETACH PARTITION.

To do:

  * Add check to prohibit multiple partitioned tables (causes crash)
  * Change ATTACH/DETACH to be incremental (presently does a REFRESH)
  * Figure out issue with multiple tables and correct it
2024-09-26 10:22:45 -06:00
Yugo Nagata
3de95c09fa Improve refresh_immv behavior a bit
- Allow to use qualified name
- Confirm if executed by the owner of the IMMV
- Improve the message when specified relation is not an IMMV
- Create a unique index at refresh with no dat if possible
  This is actually required, but we want it behave as same
  as the pgsql-ivm version for now.
2022-06-23 11:33:06 +09:00
thoshiai
51a944b388 Add refresh_immv() function
refresh_immv(immv_name, with_data) is a function to refresh IMMV like
 REFRESH MATERIALIZED VIEW command. It has two argument.
immv_name is incrementally maintainable materialized view's name, and
with_data is an option that is corresponding to the WITH [NO] DATA option.
When with_data is set false, the IMMV gets unpopulated.

One of differences between IMMVs unpopulated by this function and
normal materialized views unpopulated by REFRESH ... WITH NO DATA
is that such IMMVs can be referenced by SELECT but return no rows,
while unpopulated materialized views are not scanable.

The behaviour may be changed in future to raise an error when unpopulated
an IMMV is scanned.
2022-06-16 03:06:47 +09:00