Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxavv-0006LR-Nz for pgsql-docs@arkaria.postgresql.org; Tue, 22 Nov 2022 21:35:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxavt-0001hT-ON for pgsql-docs@arkaria.postgresql.org; Tue, 22 Nov 2022 21:35:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxavt-0001hK-GY for pgsql-docs@lists.postgresql.org; Tue, 22 Nov 2022 21:35:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxavq-0005B6-QG for pgsql-docs@lists.postgresql.org; Tue, 22 Nov 2022 21:35:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2AMLZqu83558402; Tue, 22 Nov 2022 16:35:52 -0500 From: Tom Lane To: Bruce Momjian cc: robrwo@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: crosstab documentation should add a note about use in materialized views In-reply-to: References: <166608181322.2042183.16156070469788658076@wrigleys.postgresql.org> Comments: In-reply-to Bruce Momjian message dated "Tue, 22 Nov 2022 16:28:10 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3558400.1669152952.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 22 Nov 2022 16:35:52 -0500 Message-ID: <3558401.1669152952@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: >> When using a crosstab in a materialized view, if the SQL is not qualifi= ed >> with a schema, that restoring a database from a dump may fail. See the >> discussion in >> https://www.postgresql.org/message-id/16202-b6b345c9d2819409%40postgres= ql.org > I am trying to understand the scope of this breakage. I think it is > because crosstab specifies queries as strings, and a materialized view > has to run the query during restore to populate the materialized view. = > Is this the only combination of pg_dump restore breakage? It doesn't sound like this is in any way unique to crosstab. Any underqualified reference to a user-defined object can cause problems during dump/restore, because of the restricted search_path we use during restore. regards, tom lane