pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Johannes Graën <johannes@selfnet.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: found xmin x from before relfrozenxid y
Date: Sun, 21 Oct 2018 16:57:15 +0200
Message-ID: <8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de> (raw)
In-Reply-To: <3266.1540131856@sss.pgh.pa.us>
References: <0662ea90-5249-4b8d-faa3-4abe4c88135a@selfnet.de>
	<3266.1540131856@sss.pgh.pa.us>

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
> $$;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (5+ messages)  latest in thread

Message-ID: <8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de>
Permalink:  ../8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de/
Also on:    postgresql.org/message-id/8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: johannes@selfnet.de
  Subject: Re: found xmin x from before relfrozenxid y
  In-Reply-To: <8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de>
  References: <0662ea90-5249-4b8d-faa3-4abe4c88135a@selfnet.de> <3266.1540131856@sss.pgh.pa.us> <8d5a4917-c782-4250-819e-2a1effc53f31@selfnet.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox