Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqwDy-003agd-0t for pgsql-general@arkaria.postgresql.org; Fri, 13 Feb 2026 16:40:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqwDx-00FNKD-1g for pgsql-general@arkaria.postgresql.org; Fri, 13 Feb 2026 16:40:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqwDx-00FNK4-0X for pgsql-general@lists.postgresql.org; Fri, 13 Feb 2026 16:40:57 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vqwDv-00000000WCS-47rX for pgsql-general@postgresql.org; Fri, 13 Feb 2026 16:40:57 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-463960df4f9so669020b6e.0 for ; Fri, 13 Feb 2026 08:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771000853; cv=none; d=google.com; s=arc-20240605; b=M6oHojPYdEu2b/9RLayj3xadbYEKGAaQe7DIVXEPrIb6f8zOqnzdRgxdFAoG2yh7Zo aiXngL3efbNabh0sqToWRlnyYeViQfUwvtTmGonr7RDDYi/cpbPN4Kj3uYl8txkUU10T R03bDtBt0wMqZuiddpbQ7ThsJzG7B8D83w/+DSxCNOZSAZBc64rLA4rwBC8sPJiLk2RJ GoiT9M9k7cyLG9U2fcKJM77BvTPqsGg6PZmZ/9Ej5zpBDxqmkfhG/39Kkp6ZFo0mt+1c KN/xIUyyeWarBXWE1k/cKIXS7xrMofYlhHWugkY3S9HGZwLU3lqzizzWiPCKUuhNaATa bFcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7xHHT1pLxXMmoJIFgE+kqrgL/UAtZJxKkoaw7uqyRcg=; fh=KNSq+t9BltSXFnT3Yof/aKGBtqxeA+bTALiYdvTslaY=; b=jTMHjsTNUqFyu4IkwivEXf+9QM54xEv+EL6O1IjhmDZT7leeN1tZXZRSq96kHEpuy+ 6QkwYauAZwxfG1TBJFVKBgHcxyP1Zt/PNL41arDHKvDbbcUcLQ1RqddKUZBfM/VkpDV5 6O7e9IaIjvhl7H868UFasj6hPHW50rYMIkNA0xUxk4yh3D9BDKJ3mYyBXzciIU2HKnd0 wlsZWGclnY7VKMWVidn7IZR0niunb+8GVvVyMV+mAuan0y4vi4CmYrnS2iokKWB2ta1a oVSwObk49edT/LE/DG92NmG7t+cPn1zRQYQS3yqFSuDw3Lx5/21zhCfT86zUj2xEUiH4 QiwA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771000853; x=1771605653; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=7xHHT1pLxXMmoJIFgE+kqrgL/UAtZJxKkoaw7uqyRcg=; b=ZwhPShc7J8+R3JxZrlEPoHsvsKkQ32lw/z+iBICdaklLWd158FU6epKwtBQnWBCN99 L4F4hCzwdA1dkq1x/xuqQbAF14+hsJw8yNIiPGcxwfRH1gBxF+fNwqzxZIZSWnb/D4my rRMplBfe/a4WnbBopfTZbLp6rRloqEx939HyVQq1jtRFYq0ll6Uv1Xzfjc/ymuL7ew/S J0r/rIWJVRHdJakXPeVN6uPIaFC2Gh9dMxxjHzlXOQjJA61PuskLeKq887S3UiLCkkfh hPJVb6FrAUmKmAJ4gkXjMe4UpbaPWRgj3V2JabtNe6v4xJIJNjcIa/zxzdNHexE88TWp EFjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771000853; x=1771605653; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7xHHT1pLxXMmoJIFgE+kqrgL/UAtZJxKkoaw7uqyRcg=; b=aR2aKTM/BDRzGigtxoutv5xWGmWOxHo/DqGPuPsu+kJcP5pEz7xlhcmhy+/T0ovaNq +84s6+bSssp+fL48RzJE/GxH3JPhW0ShxCp2eL7PcZ1hcdyvm8u1xeyXuJSWMzqPzSee BKmKhzJm2bdti73yRG8gzfKa7jXGb5FZnJv/yQHSAwCYt/q1cXBb3LLalwunTP2sgn5R wnLqEF0lLgup4mdKtsdW6Y4mJeGsJXHNYhh4alKCx4ABETQJIiTaQTSewJgLOcr231zl GLTR3pahlTXv4MS1on/nEtzi6c+xaBdbWqTUxjzkmFhxNbGGF5FcF+uE4hXm9uyyQE/x bxsw== X-Gm-Message-State: AOJu0YxOdcmmgxzOm76GJkc84Akz7aolTje+WEetzA11zVJ3O05GDA/N aTm87ElVDI3VRLpx0fHyehRjeB3WU18TNGHUVmEBWFEyHwUIfRmT/d17alIZ0ls7vfzY5kB7YYO K0B/QteEMxEGU40XEDotpCHep+EiWjpGoQ/XK X-Gm-Gg: AZuq6aK9Mb21dsdMn9rDjNa/HAIGDE8Lw9e8B/oHK0gqpEUNJZFfwXHrXhxJX5E8/8b U3xkh9PMs4SYdecF/dWpFyvJ8A06rOkniZaKfu6G+MqR1lxxbsQJkJI3YD83ZVS5aEYI8+/pHoq kVBY/3MQI/NQGgWleti4jBOWvRLsQKsGGEfb9FKMhUxAOQ6HDJQ203OXUHXQwrlReC2sFa6Tp3t ZajrpvDgtg0eUSDNUyZ0f3xjn+GhA+Fg7yCPsqRSUVn+ziIBv6tzzGDP9OpIbdC8HchNLlo/yE9 QwqjEJ+L X-Received: by 2002:a05:6808:1883:b0:45e:f91c:7b with SMTP id 5614622812f47-4639f2330afmr1143292b6e.54.1771000853021; Fri, 13 Feb 2026 08:40:53 -0800 (PST) MIME-Version: 1.0 References: <6511b21d495f1c010f05ae9841ee3fdc649dcff2.camel@cybertec.at> <9dccf4f8-2d45-4e6e-a374-1de66d6cc243@aklaver.com> <2263e480-ce7c-4e85-bc90-ba095d4711db@aklaver.com> In-Reply-To: <2263e480-ce7c-4e85-bc90-ba095d4711db@aklaver.com> From: Ron Johnson Date: Fri, 13 Feb 2026 11:40:42 -0500 X-Gm-Features: AaiRm53rGK6pEntmEmK-ENM4CGlezXqc0fp10LyeO51CTM2Ob5Cyo-2iVJjDzro Message-ID: Subject: Re: pg_restore failed on foreign key constraint To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000bdc778064ab7440f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bdc778064ab7440f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 13, 2026 at 11:14=E2=80=AFAM Adrian Klaver wrote: > On 2/13/26 08:05, Ron Johnson wrote: > > On Fri, Feb 13, 2026 at 10:55=E2=80=AFAM Adrian Klaver > > > wrote: > > > > On 2/13/26 06:18, Ron Johnson wrote: > > > On Fri, Feb 13, 2026 at 1:43=E2=80=AFAM Laurenz Albe > > > > > > >> wrote: > > > > > Turns out that there's a nightly cron job that dumps this (and > > other) > > > tables with the "--data-only --disable-triggers" options and the= n > > does > > > "psql -Xaf mumble.sql" to load them into this database. > > > > > > But access_email_id=3D2073 is in the source access_email, so I'v= e > > got to > > > figure out why it's not being loaded into the target. > > > > Is it in the dump file from the source? > > > > > > Some tables aren't being dumped at the source; Thus, the missing > records. > > Un-confuse me, how do the below relate?: > > "Turns out that there's a nightly cron job that dumps this (and other) > tables with the "--data-only --disable-triggers" options and then does > "psql -Xaf mumble.sql" to load them into this database. > > But access_email_id=3D2073 is in the source access_email, so I've got to > figure out why it's not being loaded into the target." > > and > > "Some tables aren't being dumped at the source" > Table name Source Dumped Target Loaded public.access_email No No public.rel_user_email Yes Yes Thus, while new and modified records are being added to public.access_email at the source, they are not making it to the Target database. That plus "--disable-triggers" lets the public.rel_user_email loads succeed on the target even though it breaks RI. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000bdc778064ab7440f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Feb 13, 2026 at 11:14=E2=80=AFAM = Adrian Klaver <adrian.klave= r@aklaver.com> wrote:
On 2/13/26 08:05,= Ron Johnson wrote:
> On Fri, Feb 13, 2026 at 10:55=E2=80=AFAM Adrian Klaver
> <adr= ian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0On 2/13/26 06:18, Ron Johnson wrote:
>=C2=A0 =C2=A0 =C2=A0 > On Fri, Feb 13, 2026 at 1:43=E2=80=AFAM Laure= nz Albe
>=C2=A0 =C2=A0 =C2=A0<laurenz.albe@cybertec.at <mailto:laurenz.albe@cybertec.at><= br> >=C2=A0 =C2=A0 =C2=A0 > <mailto:laurenz.albe@cybertec.at
>=C2=A0 =C2=A0 =C2=A0<mailto:laurenz.albe@cybertec.at>>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0 > Turns out that there's a nightly=C2=A0cro= n job that dumps this (and
>=C2=A0 =C2=A0 =C2=A0other)
>=C2=A0 =C2=A0 =C2=A0 > tables with the "--data-only --disable-t= riggers" options and then
>=C2=A0 =C2=A0 =C2=A0does
>=C2=A0 =C2=A0 =C2=A0 > "psql -Xaf mumble.sql" to load them= into this database.
>=C2=A0 =C2=A0 =C2=A0 >
>=C2=A0 =C2=A0 =C2=A0 > But access_email_id=3D2073 is in the source a= ccess_email, so I've
>=C2=A0 =C2=A0 =C2=A0got to
>=C2=A0 =C2=A0 =C2=A0 > figure out why it's not being loaded into= the target.
>
>=C2=A0 =C2=A0 =C2=A0Is it in the dump file from the source?
>
>
> Some tables aren't being dumped at the source;=C2=A0 Thus, the mis= sing records.

Un-confuse me, how do the below relate?:

"Turns out that there's a nightly cron job that dumps this (and ot= her)
tables with the "--data-only --disable-triggers" options and then= does
"psql -Xaf mumble.sql" to load them into this database.

But access_email_id=3D2073 is in the source access_email, so I've got t= o
figure out why it's not being loaded into the target."

and

"Some tables aren't being dumped at the source"

Table name=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 Source Dumped=C2=A0 =C2=A0Target Loaded
public.access_email=C2=A0 =C2=A0No=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 No
public.rel_user_email Yes=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0Yes

Thus, while new and modified = records are being added to=C2=A0public.access_email at the source, they are= not making it to the Target database.=C2=A0 That plus "--disable-trig= gers" lets the=C2=A0public.rel_user_email loads succeed on the target = even though it breaks RI.

--
Death to <Redacted>, and butter sauce.
Don't b= oil me, I'm still alive.
<Redacted> lobster!
--000000000000bdc778064ab7440f--