Re: found xmin x from before relfrozenxid y - Mailing list pgsql-general

From Johannes Graën
Subject Re: found xmin x from before relfrozenxid y
Date
Msg-id 8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de
Whole thread Raw
In response to Re: found xmin x from before relfrozenxid y  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thanks for your answer.

On 21/10/2018 16.24, Tom Lane wrote:
> In the meantime, the only answer I can think of offhand is to manually
> do VACUUM FREEZE on each of your MVs, and then refresh anything that
> shows up with an error.

Since I have so many of them, I decided to go for a quick-and-dirty
solution (what about REFRESH ALL MATERIALIZED VIEWS in the future?):

> DO
> $$
> DECLARE command text;
> BEGIN
>         FOR command IN SELECT 'REFRESH MATERIALIZED VIEW '|| nspname||'.'||relname||';'
>                 FROM pg_catalog.pg_class c
>                 LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
>                 WHERE c.relkind = 'm'
>         LOOP
>                 RAISE NOTICE '%', command;
>                 EXECUTE command;
>         END LOOP;
> END
> $$;




Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: found xmin x from before relfrozenxid y
Next
From: Tim Clarke
Date:
Subject: Re: archive items not in correct section order