Re: Is there a way to avoid “refresh materialized view” generating WAL? - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Is there a way to avoid “refresh materialized view” generating WAL?
Date
Msg-id f72b12d08cde001b33072c6ec12c11cf2cc78f68.camel@cybertec.at
Whole thread
In response to Is there a way to avoid “refresh materialized view” generating WAL?  (李明 <liming185216@126.com>)
List pgsql-admin
On Tue, 2026-09-08 at 09:50 +0800, 李明 wrote:
> We are using materialized view to speed up complex query,and found that every time
> we execute the command:refresh materialized view mv_name,it generated lots of WAL
> (the size is almost the same as the base table).
>
> I checked the manual but did not find a “unlog” for materialized view.
>
> So, Is there a way to avoid “refresh materialized view” generating WAL?or suppress it?

Currently, that is not possible.

There *were* unlogged materialized views originally, but the sign was flawed (it was
not possible to distinguish between a valid empty materialized view and one that was
empty because of crash recovery), so the feature was deactivated.

There is currently a patch in development to get them back:
https://commitfest.postgresql.org/patch/7167/
The best you can do is to test and review the patch to promote its acceptance.

Yours,
Laurenz Albe



pgsql-admin by date:

Previous
From: 李明
Date:
Subject: Is there a way to avoid “refresh materialized view” generating WAL?
Next
From: Ron Johnson
Date:
Subject: Re: Seeking Recommendations for PostgreSQL Backup, Restore, and Upgrade Strategy