pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: JED WALKER <jedwa@comcast.net>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: Jed@ICD <jed.walker@icd-tech.com>
Subject: Re: v12.4 pg_dump .sql fails to load data via psql
Date: Mon, 11 Oct 2021 18:55:25 -0400
Message-ID: <526204.1633992925@sss.pgh.pa.us> (raw)
In-Reply-To: <375102856.69594.1633991178400@connect.xfinity.com>
References: <375102856.69594.1633991178400@connect.xfinity.com>

JED WALKER <jedwa@comcast.net> writes:
> PostgreSQL v12.4 pg_dumpall output fails to load via "psql -f" load to empty 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-CONSTRAINTS-CHECK-CONSTRAINTS





view thread (5+ messages)  latest in thread

Message-ID: <526204.1633992925@sss.pgh.pa.us>
Permalink:  ../526204.1633992925@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/526204.1633992925@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jedwa@comcast.net, pgsql-bugs@lists.postgresql.org, jed.walker@icd-tech.com
  Subject: Re: v12.4 pg_dump .sql fails to load data via psql
  In-Reply-To: <526204.1633992925@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox