pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@lists.postgresql.org, Claudio Freire <klaussfreire@gmail.com>
Subject: Re: pg_upgrade and materialized views
Date: Tue, 20 Feb 2018 19:23:57 -0500
Message-ID: <2777.1519172637@sss.pgh.pa.us> (raw)
In-Reply-To: <1AA7ED45-0DE1-481E-B174-602121425F53@anarazel.de>
References: <CAGTBQpbrY9CdRGGhyBZ9yqY4jWaGC85rUF4X+R7d-aim=mBNsw@mail.gmail.com>
	<23575.1519162064@sss.pgh.pa.us>
	<CAGTBQpY0wu1UiPUMjDCTrxaR92EETXBqo0+fPDGeBbg-v64J7A@mail.gmail.com>
	<24838.1519163208@sss.pgh.pa.us>
	<CAGTBQpZHSPXNZh-DY319FVuuz3o1c-fH-Dkc9R656MOP0AgcPw@mail.gmail.com>
	<CAGTBQpZ2-7hBs0T+JRFWqzvW_qqo=Qe+oYivnM1OPZGp2z0KOQ@mail.gmail.com>
	<CAGTBQpYxOGMfiwc6Anfok0wEr-kxyFXXiWnDaCJH+2AQDEaCHA@mail.gmail.com>
	<32726.1519170287@sss.pgh.pa.us>
	<1AA7ED45-0DE1-481E-B174-602121425F53@anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On February 20, 2018 3:44:47 PM PST, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Anyway, I'm thinking the core of the problem here is that we've got
>> multiple places that know which relkinds are physically transferred
>> during a pg_upgrade, and they don't all know the same thing.  We
>> need to centralize that knowledge somehow, or we're going to be
>> singing this same tune again in the future.  Not quite sure where
>> to put it though.  pg_dump and pg_upgrade both need to know that,
>> but the backend doesn't, so I don't quite want to add it in
>> pg_class.h where the core list of relkinds is.

> Why do we need any relkind checks here at all? Shouldn't we just transport all xid horizons that are set before into the new cluster without filtering?

The ones on relations without storage are meaningless, and I'm not
sure it's a good idea to set them nonzero if they're zero initially.
In any case, pg_upgrade *has to* be selective about which files it
tries to physically transfer --- even skipping nonexistent files
wouldn't be good enough, since it should not transfer sequence files.

Also, you were right to complain before that some of the issue here
is considering "must hack dropped columns" to be identical to
"must hack relfrozenxid".  It's not clear that that's true, eg
I think the answer is different for RELKIND_PARTITIONED_TABLE.

			regards, tom lane




view thread (31+ messages)  latest in thread

Message-ID: <2777.1519172637@sss.pgh.pa.us>
Permalink:  ../2777.1519172637@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2777.1519172637@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, klaussfreire@gmail.com
  Subject: Re: pg_upgrade and materialized views
  In-Reply-To: <2777.1519172637@sss.pgh.pa.us>
  References: <CAGTBQpbrY9CdRGGhyBZ9yqY4jWaGC85rUF4X+R7d-aim=mBNsw@mail.gmail.com> <23575.1519162064@sss.pgh.pa.us> <CAGTBQpY0wu1UiPUMjDCTrxaR92EETXBqo0+fPDGeBbg-v64J7A@mail.gmail.com> <24838.1519163208@sss.pgh.pa.us> <CAGTBQpZHSPXNZh-DY319FVuuz3o1c-fH-Dkc9R656MOP0AgcPw@mail.gmail.com> <CAGTBQpZ2-7hBs0T+JRFWqzvW_qqo=Qe+oYivnM1OPZGp2z0KOQ@mail.gmail.com> <CAGTBQpYxOGMfiwc6Anfok0wEr-kxyFXXiWnDaCJH+2AQDEaCHA@mail.gmail.com> <32726.1519170287@sss.pgh.pa.us> <1AA7ED45-0DE1-481E-B174-602121425F53@anarazel.de> <2777.1519172637@sss.pgh.pa.us>

* 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