Commit graph

4 commits

Author SHA1 Message Date
Takuma Hoshiai
b2e357612d Fix for get_immv_def()
Fix that get_immv_def() return  NULL when oid is not a Relation.
2022-09-30 17:08:51 +09:00
Takuma Hoshiai
2d9abee78c Add function of get_immv_def()
This function can reconstruct the underlying SELECT command for a
IMMV. (This is a decompiled reconstruction, not the original text
of the command)
2022-09-30 15:59:32 +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
Yugo Nagata
f2d43bb923 Fix to delete the pg_ivm_immv entry when an IMMV is dropped 2022-04-28 19:47:30 +09:00