In case someone else needs to do this - I ended up with this change in pg_dump.c around lines 17080-17090
I guess a proper solution would check the already invalid foreign keys in a different way.
appendPQExpBuffer(q, " ADD CONSTRAINT %s %s%s;\n",
fmtId(coninfo->dobj.name),
coninfo->condef
, dopt->foreign_keys_not_valid && !strstr(coninfo->condef, "NOT VALID") ? " NOT VALID":"");
fmtId(coninfo->dobj.name),
coninfo->condef
, dopt->foreign_keys_not_valid && !strstr(coninfo->condef, "NOT VALID") ? " NOT VALID":"");
On Wed, Oct 27, 2021 at 4:08 PM Tore Halvorsen <tore.halvorsen@xxxxxxxxx> wrote:
Then I'll try that, thank you :)On Wed, Oct 27, 2021 at 4:04 PM Tom Lane <tgl@xxxxxxxxxxxxx> wrote:Tore Halvorsen <tore.halvorsen@xxxxxxxxx> writes:
> That would be appending it for "pg_catalog.pg_get_constraintdef(oid) AS
> condef" in getConstraints in pg_dump.c?
No, you want to mess with the text printed by dumpConstraint().
regards, tom lane
--Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554
--
Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul]
<demo> Tore Halvorsen || +052 0553034554
<demo> Tore Halvorsen || +052 0553034554