Search Postgresql Archives

Re: pg_dump and pg_restore and foreign keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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":"");



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux