Search Postgresql Archives

Re: found xmin x from before relfrozenxid y

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux