On Tue, Feb 20, 2018 at 8:44 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Claudio Freire <klaussfreire@gmail.com> writes:
>>> Well, the attached script reproduces the issue.
>
> One thing this doesn't prove by itself is whether the use of
> REFRESH MATERIALIZED VIEW CONCURRENTLY has any effect on the
> situation.
>
> I poked at that a bit and noted that REFRESH MATERIALIZED VIEW
> CONCURRENTLY doesn't seem to change the matview's relfrozenxid
> at all, while a plain REFRESH advances the matview's relfrozenxid
> to (more or less) the current xid counter.
Probably the reason why only concurrently triggers the vacuum
assertion is because only concurrently creates dead tuples.
Vacuum won't check unless there are dead tuples, it skips all-visible pages.