Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoGKY-000325-71 for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 22:24:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eoGKX-0001z5-3g for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Feb 2018 22:24:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eoGKW-0001yv-Tx for pgsql-bugs@lists.postgresql.org; Tue, 20 Feb 2018 22:24:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eoGKT-0000wU-PZ for pgsql-bugs@postgresql.org; Tue, 20 Feb 2018 22:24:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1KMO3AQ027528; Tue, 20 Feb 2018 17:24:03 -0500 From: Tom Lane To: Claudio Freire cc: pgsql-bugs@postgresql.org Subject: Re: pg_upgrade and materialized views In-reply-to: References: <23575.1519162064@sss.pgh.pa.us> <24838.1519163208@sss.pgh.pa.us> <26015.1519164481@sss.pgh.pa.us> Comments: In-reply-to Claudio Freire message dated "Tue, 20 Feb 2018 19:13:03 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27526.1519165443.1@sss.pgh.pa.us> Date: Tue, 20 Feb 2018 17:24:03 -0500 Message-ID: <27527.1519165443@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Claudio Freire writes: > On Tue, Feb 20, 2018 at 7:08 PM, Tom Lane wrote: >> Hm? Looks to me like it iterates through all the DBs in the cluster. > You're right. But IIUC it's called before restoring globals, so only > postgres, template0 and template1 exist at that point. Hmm ... there's another call later, but that one only happens for pre-9.3 source DBs, which won't contain matviews nor partitioned tables. So maybe it's OK but I'm not quite sure, and even if it is OK it's only accidentally so. Be nice if the documentation for this code weren't so relentlessly bad --- the header comment for this function looks like it's telling you something useful, but it isn't even close to accurate. The comment right above the call in prepare_new_globals() seems unrelated to anyone's version of reality either. regards, tom lane