<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc" -->

---
title: pg_ivm 1.17 released | daily.dev
description: pg_ivm 1.17 is out, adding a replace option to restore_immv() for overwriting existing IMMV metadata entries, plus a new --pg-upgrade option for...
canonical: https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: pg_ivm 1.17 released | daily.dev
og:description: pg_ivm 1.17 is out, adding a replace option to restore_immv() for overwriting existing IMMV metadata entries, plus a new --pg-upgrade option for...
og:url: https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc
og:image: https://api.daily.dev/og/posts/I9WNzuTNC.png
og:image:alt: pg_ivm 1.17 released
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# pg_ivm 1.17 released

**[PostgreSQL](https://daily.dev/sources/postgres)** · 2 min read · 0 upvotes · 0 comments

## Summary

pg_ivm 1.17 is out, adding a replace option to restore_immv() for overwriting existing IMMV metadata entries, plus a new --pg-upgrade option for pg_ivm_dump_metadata to generate restore commands usable with pg_upgrade. The release fixes a bug where restore_immv() left ispopulated as false, which could cause duplicate IVM triggers on a later refresh_immv(). It also improves unique key derivation by using the original view definition rather than the rewritten query, enabling automatic index creation for queries such as those with EXISTS clauses. Crashes during index creation with LATERAL subqueries and an assertion failure in check_immv_compatibility() are also fixed.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.postgresql.org/about/news/pg_ivm-117-released-3420>

## Questions this post answers

### How do I restore an IMMV after running pg_upgrade with pg_ivm?

pg_ivm 1.17 adds a --pg-upgrade option to pg_ivm_dump_metadata that generates restore commands usable with pg_upgrade, and gives restore_immv() a replace option to overwrite existing IMMV metadata entries. Previously, restoring IMMVs after pg_upgrade failed because old IMMV entries remained in pg_ivm_immv.

_Track extension updates like pg_ivm's pg_upgrade fix on daily.dev before your next PostgreSQL migration._

### Why does refresh_immv() create duplicate IVM triggers after restoring a materialized view?

In pg_ivm before 1.17, restore_immv() incorrectly left ispopulated set to false after restoring an IMMV. That incorrect state could cause a later call to refresh_immv() to add a duplicate set of IVM triggers, resulting in incorrect view maintenance. Version 1.17 fixes this bug.

_Developers debugging IVM trigger issues can follow pg_ivm fixes like this one on daily.dev._

### Can pg_ivm automatically create a unique index for a materialized view that uses an EXISTS clause?

Yes, as of pg_ivm 1.17 unique key derivation now uses the original view definition instead of the rewritten query, which allows automatic index creation for queries where uniqueness can be determined from the original query shape, including queries containing EXISTS clauses.

_Those tuning incremental view maintenance can watch pg_ivm releases like this on daily.dev._

## Similar posts on daily.dev

- [pg\_ivm 1.14 released](https://daily.dev/posts/pg-ivm-1-14-released-9el2vfnot) · PostgreSQL · 1 upvotes · 0 comments
- [pg\_ivm 1.16 released](https://daily.dev/posts/pg-ivm-1-16-released-tjf3ejboo) · PostgreSQL · 5 upvotes · 0 comments
- [pgcopydb v0.18](https://daily.dev/posts/pgcopydb-v0-18-p5f6abalo) · Planet PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"pg_ivm 1.17 released","url":"https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc"},"datePublished":"2026-10-26T13:17:09.238Z","dateModified":"2026-10-29T02:14:09.539Z","description":"pg_ivm 1.17 is out, adding a replace option to restore_immv() for overwriting existing IMMV metadata entries, plus a new --pg-upgrade option for...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"PostgreSQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"PostgreSQL","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/8dab534748a94108858df41b7ef7fe86","url":"https://daily.dev/sources/postgres"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PostgreSQL","item":"https://daily.dev/sources/postgres"},{"@type":"ListItem","position":3,"name":"pg_ivm 1.17 released"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pg-ivm-1-17-released-i9wnzutnc#faq","mainEntity":[{"@type":"Question","name":"How do I restore an IMMV after running pg_upgrade with pg_ivm?","acceptedAnswer":{"@type":"Answer","text":"pg_ivm 1.17 adds a --pg-upgrade option to pg_ivm_dump_metadata that generates restore commands usable with pg_upgrade, and gives restore_immv() a replace option to overwrite existing IMMV metadata entries. Previously, restoring IMMVs after pg_upgrade failed because old IMMV entries remained in pg_ivm_immv. Track extension updates like pg_ivm's pg_upgrade fix on daily.dev before your next PostgreSQL migration."}},{"@type":"Question","name":"Why does refresh_immv() create duplicate IVM triggers after restoring a materialized view?","acceptedAnswer":{"@type":"Answer","text":"In pg_ivm before 1.17, restore_immv() incorrectly left ispopulated set to false after restoring an IMMV. That incorrect state could cause a later call to refresh_immv() to add a duplicate set of IVM triggers, resulting in incorrect view maintenance. Version 1.17 fixes this bug. Developers debugging IVM trigger issues can follow pg_ivm fixes like this one on daily.dev."}},{"@type":"Question","name":"Can pg_ivm automatically create a unique index for a materialized view that uses an EXISTS clause?","acceptedAnswer":{"@type":"Answer","text":"Yes, as of pg_ivm 1.17 unique key derivation now uses the original view definition instead of the rewritten query, which allows automatic index creation for queries where uniqueness can be determined from the original query shape, including queries containing EXISTS clauses. Those tuning incremental view maintenance can watch pg_ivm releases like this on daily.dev."}}]}
```

