The IVM Development Group has released pg_ivm 1.17, the latest version of the PostgreSQL extension that maintains incrementally updated materialized views (IMMVs). This release focuses on smoother version upgrades, correctness fixes around restoring views, and better automatic index creation.
- New
replaceoption forrestore_immv(), contributed by Yugo Nagata, lets the function replace existing IMMV metadata entries rather than fail on conflicts. - New
--pg-upgradeoption forpg_ivm_dump_metadata, which generates restore commands suited topg_upgrade. Previously, restoring IMMVs afterpg_upgradefailed because old IMMV entries lingered inpg_ivm_immv. - Bug fix (Gori):
restore_immv()leftispopulated = falseafter restoring a view, so a laterrefresh_immv()could install a duplicate set of IVM triggers and corrupt view maintenance. - Improved unique key derivation for automatic index creation: keys are now derived from the original view definition instead of the rewritten query. This enables automatic index creation for queries where uniqueness is evident from the original shape, such as those containing
EXISTSclauses. - Target lists containing set-returning functions are now rejected, since such queries cannot have a unique key even when all primary key columns are present.
The release matters most to teams running pg_ivm across major PostgreSQL upgrades: the --pg-upgrade flag turns a previously failure-prone manual restore step into a generated, repeatable command sequence. The ispopulated fix removes a subtle path to duplicated triggers that could silently produce wrong query results, while the unique key changes broaden which views can get automatic indexes built for them.
Source: https://www.postgresql.org/about/news/pg_ivm-117-released-3420/