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 1ma4Co-0008AM-Cs for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Oct 2021 22:55:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ma4Cn-0004OI-A9 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Oct 2021 22:55:37 +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 1ma4Cn-0004Js-2l for pgsql-bugs@lists.postgresql.org; Mon, 11 Oct 2021 22:55:37 +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 1ma4Cg-0006vT-RG for pgsql-bugs@lists.postgresql.org; Mon, 11 Oct 2021 22:55:36 +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 19BMtQDF526205; Mon, 11 Oct 2021 18:55:26 -0400 From: Tom Lane To: JED WALKER cc: "pgsql-bugs@lists.postgresql.org" , "Jed@ICD" Subject: Re: v12.4 pg_dump .sql fails to load data via psql In-reply-to: <375102856.69594.1633991178400@connect.xfinity.com> References: <375102856.69594.1633991178400@connect.xfinity.com> Comments: In-reply-to JED WALKER message dated "Mon, 11 Oct 2021 16:26:17 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <526203.1633992925.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 11 Oct 2021 18:55:25 -0400 Message-ID: <526204.1633992925@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk JED WALKER writes: > PostgreSQL v12.4 pg_dumpall output fails to load via "psql -f" load to e= mpty instance/server. > This occurs using check constraints that reference a function using data= in a table that is loaded later. That's never worked reliably, neither in v12 nor any other version. The function is a "black box", so the fact that it creates an ordering constraint isn't apparent to pg_dump. Note that our documentation specifically disclaims correct enforcement of CHECK constraints that reference any mutable data other than the row being checked (see NOTEs at [1]). Even if the particular scenario you describe here happened to work, there are many other cases where such a constraint could become violated after it was initially checked --- and Postgres wouldn't notice. Nor do we have any interest in making it notice. regards, tom lane [1] https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONST= RAINTS-CHECK-CONSTRAINTS