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 1wB7w2-000lJ7-2a for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Apr 2026 09:13:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wB7w1-00AsbL-0Q for pgsql-bugs@arkaria.postgresql.org; Fri, 10 Apr 2026 09:13:54 +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 1wB7w0-00AsbD-2s for pgsql-bugs@lists.postgresql.org; Fri, 10 Apr 2026 09:13:53 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wB7vz-00000000KNy-3byR for pgsql-bugs@lists.postgresql.org; Fri, 10 Apr 2026 09:13:53 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-35d8e548a05so1826655a91.1 for ; Fri, 10 Apr 2026 02:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775812430; cv=none; d=google.com; s=arc-20240605; b=cAHJTUBPTrOv6nYFwAMclU33uMSHV8QroPS+B5SsuPCoiNL3jJ8QYZ2KHJN33dIj2S puDSw7kL3IO4o53ngWkU2EaI4EN74IQr20PFMWClhby2a0kr6NMsw4RX6AKAKamZ+Usi JNZ14yYyYlEF0IJND3ofl2ohRztuGhQ2SaSLpD/Np407bV04kICr4N1SHAZW1/I8ivby AxTczdwxin/h4H+B0x5PkIdGYA4FMqepjp2NGwXaWcCjj/gUOBONB4OEXUr+cbWBJU7H 9uBDYRvwVdNsARevsDjANVr9aziy0TRaqG0dpuiFpjvgWWYDznKACVOBM9WT4kIajYX/ q47g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jDcRRM7Df2u7bAM0VYPFZnirZ2w3oO2cxTAtoETKgUY=; fh=2LQqVKe3K3WoDl0FeO4sv3CuyRzScnI7mGRg1lxUam8=; b=QD7aqpbwslZoXqCUkeI1kQ0KZsK7fK2eva5vE+j/lhQm1Jsd6PyetonIKsmouRUnc6 tU5KtR/kDaVsbe3Dcp+jdOF5Wy8th02lsQ4AAL5ku2ouUz0SIVR/bLL7fiwaG0t6M7Ze TiVG/F8crVf7w+ADaRboc43/+YsiSTGZnjSWuJGI7OuNR423NtJDzJluuWr0A4iJLPXz EhibQhYHLsnjoOiPsIMu2UKk3FCdY4GsgijYFTy2/rMg37TuaoKzJCnQDrFlS7Ee1+PD BKmv6MWIzzlpy+/Qb+FMAzYMXHRRTQYLrte2Y4E3sqjPZxYqAniATirHBYTZdNVmKNo7 mL4w==; darn=lists.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=20251104; t=1775812430; x=1776417230; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jDcRRM7Df2u7bAM0VYPFZnirZ2w3oO2cxTAtoETKgUY=; b=VpTmhbE1WWKvjA+Akgq6HRybpmlOFqA6CLSCR2qwvzkTJcWfmLDciGJzR4Uu/MCjGo DfZv7Cvhs2g8kk8KWoJLjyl9ntdanqY1bq4uAjQ70wHYXf49pwJq9ODQqcKxfV3tbva6 De359KNBZBFHUEknqaY2naAYKalcJQyAFQvX2PEh09axIOrCZ27cn4kARKPmSN9KjZe+ rk1boygc1PdvQVhhql/0Q2ZFYsrRjAW9fzdxMZt9ocdS2wSmiCiFWwEl00TkPttx/RiM jsX56tAF9f5Df6Z79MTSCIHioDCdzXWy8Nb2C7a+vnQx93msWqaqyi9WakQ1gUoZPOg0 ZdUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775812430; x=1776417230; h=content-transfer-encoding:cc: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=jDcRRM7Df2u7bAM0VYPFZnirZ2w3oO2cxTAtoETKgUY=; b=NBeob4g9C7cvDSKdXyy6TNQDe+i9ZyykS6la73wJJbTNy+TdA2J5s33EN5eZe/2sfl wmcJr/deXX2lF0LlvKoRkC8ZEcgK/0vyKhD2HQiO72nD5MJ5E9WYWZ1S7WS02SkvLAQC bX2vyve31mb3MJuq3IPBo0inBdc3gvY2Vd8xN3tNakg9K4bQ8jefM4mMzbVU2oRGqzE7 0wRFSVoAp4Pi9JWD9yXqJ2i/arZmmYx5tfmmH6Knn7mviWDh5dX26WguSIW9kjwvWvG2 Desq/D76dXp3zk88jSYsB/ZYAJM91QF0p8GSc6n8BjIwxZ3Qjy2AUYrw5ZpYY63fYo1C PuiA== X-Forwarded-Encrypted: i=1; AJvYcCU1ZsWce47ldV1gxmtGr+nMOKWmg9k2XQ5FiIJTE1ySa8Q+gOKKPLdepuZvE6EHoJD7EVf28IbfV7OI@lists.postgresql.org X-Gm-Message-State: AOJu0YzW9cZcq4677kvzWnnmD7xmxu+bCKlLz1yiyTmmGBTgy2e1wzlN 2M/dCdIqGHpzvYpzNN3800EMlffFItYh4kYXqYUjHrh+wCMP6D0VmAdMjyynY4AJQBo/X3/9P+V nV16boUW0XwKbVCeagTu60y4/hZuDAlc= X-Gm-Gg: AeBDietSZEhfKAKupjWq1QHQ+UDqUz/MxpApooiSHDLAU9uD6z33sa3dfua8kdObu8W C10x4fV9tHYR9uKZvC9P8EA7tOK5Xz6nin+Do1qnQHOSo/avFEJ+yX0i57gMeGkyCvYzN6Na7Az zZvMm4zVGPiaBLDbmdrxQNiOgg7/A2aERvFXC8CiuSkU1rS1stW7H+072GZksyHVidTzZI0be4E lVXYNv4qW3+XId9JRGOGXo6FKYIh7JPDWeLJ+cfD7BBNrL0nwgD/dyr8IOVY358xED9BcHRpxaX MtTKEDY5XujKJ2ZdkcpcbrFoUYc+1Cax/j/RafIK6EBquncBBgNUd05afxmFbz9O X-Received: by 2002:a17:90b:3c4d:b0:35b:9682:51e6 with SMTP id 98e67ed59e1d1-35e4282bf0fmr2884717a91.16.1775812429898; Fri, 10 Apr 2026 02:13:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Langote Date: Fri, 10 Apr 2026 18:13:33 +0900 X-Gm-Features: AQROBzCV4_CjAzD3R7YECIIFgTKhXE918JtcQNBJKOeSEUQTVLVSnwGsq4BO_rM Message-ID: Subject: Re: BUG: PostgreSQL 19devel throws internal opfamily error for FK with reordered referenced columns To: Fredrik Widlert Cc: Junwang Zhao , Matheus Alcantara , pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Apr 10, 2026 at 5:05=E2=80=AFPM Amit Langote wrote: > On Fri, Apr 10, 2026 at 4:29=E2=80=AFPM Fredrik Widlert > wrote: > > Thanks for the very quick fix - it's a great feeling to report a proble= m > > and get it fixed this quickly. > > Credit goes to Matheus for quickly submitting a well-written patch. > > > I can confirm that the fix solves not only the small reproducer but als= o > > the original problems I got when trying to install our (large) system > > on PostgreSQL 19 devel for testing. > > Thanks for confirming that. > > > We actually ran into the same problem in two ways: > > * the reordered FK with datatype mismatch (my reproducer) > > * other reordered FKs with the same datatypes, where we instead got > > regular FK violations > > > > In case you want a reproducer for the second case as well, I've include= d it below, > > but perhaps it's not relevant since the patch already fixed it. > > > > ---- > > drop table if exists parent, child; > > > > create table parent ( > > c1 integer, > > c2 integer, > > primary key (c1, c2) > > ); > > > > create table child ( > > c1 integer, > > c2 integer, > > constraint child_fk foreign key (c2, c1) references parent (c2, c1= ) > > ); > > > > insert into parent (c1, c2) values (1, 2); > > insert into child (c1, c2) values (1, 2); > > Good to know. It's worth adding this case next to the ones Matheus's > patch added, which the attached patch does. Will push it shortly. And done. --=20 Thanks, Amit Langote