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-0005IP-AY 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-0004VV-8X for pgsql-general@arkaria.postgresql.org; Tue, 06 Dec 2022 15:24:02 +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 1p2HTP-00049f-MI for pgsql-general@lists.postgresql.org; Mon, 05 Dec 2022 19:49:55 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2HTN-0005EU-FE for pgsql-general@postgresql.org; Mon, 05 Dec 2022 19:49:54 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id a17so8948638qvt.9 for ; Mon, 05 Dec 2022 11:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:reply-to:message-id:date:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=t02fXdukvJShfBFgelJbc8M/5vk/h9CfL3B5tFnZG1A=; b=F8YEaLQMLPqCLPtgtO01s8B1ZzDQg5e8pMcxh/fljRTBgE0CSE01SlHwz7gawlKxn7 VTrTgG5QJVw15gqcERVeuVPb7JRWB90bsb9KVxexM3pZBYpCB73WcoCz0f1VIVY7cFCC i27AAn8ZCMibANUi3DV7p0MwG35l+eEkrxeDV4jXF298qQDTURGmD8sDXnfXFhvJt6Ie IL2OMfdKs+TVp18jQToW2eBEH7MbB0E+fblr6berAF5UpgaGMmevR5MJZoDHobyCfL2w UnLJMw2ngWisduVID2o4kdDQDRV730qKyvqsYDz1/v5Mm8gFKq7F4620OGec4JbX6Pkq 0mFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:reply-to:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t02fXdukvJShfBFgelJbc8M/5vk/h9CfL3B5tFnZG1A=; b=6JNLcCXVDGbdAFApdnHB52evUTDErMhCIQoKtOrh8iA1KFFPyapN+Z8x5C4fO2MjD7 gWSYVUAkdhhjZd10d37m1Dx7OcX4S/wnp3oiRahz1sLr3h0Mnnx2JFBUDGCxh5KTDqCw cNJHw/BroD31SkAzUaxg4UGdsPWD1dMpLhtuMbJrIQyeurc5wmTa7IL+6viffasP8OQF biE10Ub9Nc4ZRfJqOIcbsFhYPe4Nz4AZjcDs56t7XWTG4W8V24GA13313DmbnyUpvJ/U Yp3c8f8EzavWVUDpttl0BPFqexEmGKm9h2uN4atroiDfYbHbKzthbFFGWdw6KhICqFo7 dnfQ== X-Gm-Message-State: ANoB5pn/25oJEpf7bIafRLJG3F4yjAdBrSSYHQ+JA1cx0VDaDD+YBxbN mh7tu1UI7xbHjhJsCduc2UVSAdV0x7M= X-Google-Smtp-Source: AA0mqf7vMWTMRVmaO2S/QoIC+q0aQdcZgfFgESQr7jIRolcGInVM9K5MsoIXw+gJXi1HsMvFEV8NrQ== X-Received: by 2002:a0c:80e6:0:b0:4c7:1ae2:2787 with SMTP id 93-20020a0c80e6000000b004c71ae22787mr24807546qvb.89.1670269792253; Mon, 05 Dec 2022 11:49:52 -0800 (PST) Received: from [192.168.128.53] (c-71-234-60-75.hsd1.ct.comcast.net. [71.234.60.75]) by smtp.gmail.com with ESMTPSA id q20-20020ac84514000000b003a7e4129f83sm2558792qtn.85.2022.12.05.11.49.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2022 11:49:51 -0800 (PST) From: "Nunya Business" To: pgsql-general@postgresql.org Subject: PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns Date: Mon, 05 Dec 2022 19:49:40 +0000 Message-Id: Reply-To: "Nunya Business" User-Agent: eM_Client/9.1.2109.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------=_MB0CC06A78-3053-434A-9193-67A897E697DA" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --------=_MB0CC06A78-3053-434A-9193-67A897E697DA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Good afternoon, I've recently run into a weird issue that I'm trying to gather more data=20 on before sending an official bug report on the off chance that it's=20 already been addressed. Within my schema there is a table that has a GENERATED ALWAYS column=20 that calls a plpgsql function. The called function has a "row type"=20 variable declared that references a view. While the schema itself=20 functions properly day to day, and pg_dumpall works as expected, the=20 generated SQL fails to successfully execute. The table in question is=20 restored with no rows, and an error is generated during the COPY stating=20 that the type does not exist. The issue appears to be that the COPY statement for the data is trying=20 to execute the function specified for the GENERATED ALWAYS column, and=20 that function cannot run because the view that the function references=20 does not yet exist. The dump was made with: pg_dumpall -c --quote-all-identifiers=20 --exclude-database=3Dpostgres --exclude-database=3Dtemplate0=20 --exclude-database=3Dtemplate1 Is this a known or unknown issue, or am I just missing something? Any insight is appreciated. Please reply-all as I'm not currently=20 subscribed to the list. Thanks in advance! --------=_MB0CC06A78-3053-434A-9193-67A897E697DA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Good afternoon,

I've recently run into a weird i= ssue that I'm trying to gather more data on before sending an official bug= report on the off chance that it's already been addressed.

=
Within my schema there is a table that has a GENERATED ALWAYS co= lumn that calls a plpgsql function.=C2=A0 The called function has a "row ty= pe" variable declared that=C2=A0 references a view.=C2=A0 While the schema= itself functions properly day to day, and pg_dumpall works as expected, the = generated SQL fails to successfully execute.=C2=A0 The table in question i= s restored with no rows, and an error is generated during the COPY stating= that the type does not exist.

The issue appears= to be that the COPY statement for the data is trying to execute the functio= n specified for the GENERATED ALWAYS column, and that function cannot run b= ecause the view that the function references does not yet exist.
=
The dump was made with: pg_dumpall -c --quote-all-identifi= ers --exclude-database=3Dpostgres --exclude-database=3Dtemplate0 --exclude-= database=3Dtemplate1

Is this a known or unknown= issue, or am I just missing something?

Any insig= ht is appreciated.=C2=A0 Please reply-all as I'm not currently subscribed t= o the list.=C2=A0 Thanks in advance!
--------=_MB0CC06A78-3053-434A-9193-67A897E697DA--