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 1p2Znf-0005IR-Ly for pgsql-general@arkaria.postgresql.org; Tue, 06 Dec 2022 15:24:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Zne-0004VT-8T for pgsql-general@arkaria.postgresql.org; Tue, 06 Dec 2022 15:24:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2Znd-0004VI-UC for pgsql-general@lists.postgresql.org; Tue, 06 Dec 2022 15:24:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2Znb-0001SJ-WE for pgsql-general@postgresql.org; Tue, 06 Dec 2022 15:24:01 +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 2B6FNvcp3635235; Tue, 6 Dec 2022 10:23:57 -0500 From: Tom Lane To: "Nunya Business" cc: pgsql-general@postgresql.org Subject: Re: PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns In-reply-to: References: Comments: In-reply-to "Nunya Business" message dated "Mon, 05 Dec 2022 19:49:40 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3635233.1670340237.1@sss.pgh.pa.us> Date: Tue, 06 Dec 2022 10:23:57 -0500 Message-ID: <3635234.1670340237@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Nunya Business" writes: > Within my schema there is a table that has a GENERATED ALWAYS column > that calls a plpgsql function. The called function has a "row type" > variable declared that references a view. While the schema itself > functions properly day to day, and pg_dumpall works as expected, the > generated SQL fails to successfully execute. The table in question is > restored with no rows, and an error is generated during the COPY stating > that the type does not exist. Hmm, do you have actually circular dependencies in that? pg_dump has some heuristics for dealing with such cases, but maybe it needs more. Please create a self-contained example and submit it to pgsql-bugs. regards, tom lane