Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWMcC-0004VL-9L for pgsql-committers@arkaria.postgresql.org; Thu, 08 Sep 2022 18:51:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oWMcA-0004yk-ST for pgsql-committers@arkaria.postgresql.org; Thu, 08 Sep 2022 18:51:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWMcA-0004yX-L1 for pgsql-committers@lists.postgresql.org; Thu, 08 Sep 2022 18:51:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWMc7-0007mi-RF for pgsql-committers@lists.postgresql.org; Thu, 08 Sep 2022 18:51:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 288Iou5O4104620; Thu, 8 Sep 2022 14:50:56 -0400 From: Tom Lane To: Alvaro Herrera cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Choose FK name correctly during partition attachment In-reply-to: References: Comments: In-reply-to Alvaro Herrera message dated "Thu, 08 Sep 2022 11:19:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4104618.1662663056.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 08 Sep 2022 14:50:56 -0400 Message-ID: <4104619.1662663056@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Choose FK name correctly during partition attachment Some of the buildfarm is unhappy with this, most clearly so here: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dlapwing&dt=3D202= 2-09-08%2015%3A30%3A25 ore was generated by `postgres: postgres regression [local] ALTER TABLE = '. Program terminated with signal 6, Aborted. #0 0x2a460417 in raise () from /lib/i386-linux-gnu/libc.so.6 #0 0x2a460417 in raise () from /lib/i386-linux-gnu/libc.so.6 #1 0x2a463802 in abort () from /lib/i386-linux-gnu/libc.so.6 #2 0x0864edf8 in ExceptionalCondition (conditionName=3DconditionName@entr= y=3D0x878fc10 "*updateTriggerOid =3D=3D InvalidOid", errorType=3DerrorType= @entry=3D0x86b174f "FailedAssertion", fileName=3DfileName@entry=3D0x878f1b= b "tablecmds.c", lineNumber=3DlineNumber@entry=3D10591) at assert.c:69 #3 0x082e7c57 in GetForeignKeyActionTriggers (updateTriggerOid=3D, deleteTriggerOid=3D, conrelid=3D21128, con= frelid=3D21128, conoid=3D21141, trigrel=3D0x213c28f0) at tablecmds.c:10591 #4 CloneFkReferenced (partitionRel=3DpartitionRel@entry=3D0x212beb5c, par= entRel=3D,= parentRel=3D) at tablecmds.c:10117 #5 0x082f19e9 in CloneForeignKeyConstraints (wqueue=3D0xffd430c0, parentR= el=3D0x212b6a98, partitionRel=3D0x212beb5c) at tablecmds.c:9955 #6 0x082fc8c8 in ATExecAttachPartition (wqueue=3Dwqueue@entry=3D0xffd430c= 0, rel=3Drel@entry=3D0x212b6a98, context=3D, cmd=3D, cmd=3D) at tablecmds.c:17852 #7 0x082ff709 in ATExecCmd (wqueue=3Dwqueue@entry=3D0xffd430c0, tab=3Dtab= @entry=3D0x8e44180, cmd=3D0x8dff454, lockmode=3Dlockmode@entry=3D4, cur_pa= ss=3Dcur_pass@entry=3D10, context=3Dcontext@entry=3D0xffd43284) at tablecm= ds.c:5227 #8 0x08300e87 in ATRewriteCatalogs (context=3D0xffd43284, lockmode=3D4, w= queue=3D0xffd430c0) at tablecmds.c:4878 #9 ATController (parsetree=3D0x8d5d574, parsetree@entry=3D0x1, rel=3D, cmds=3D, recurse=3Dtrue, lockmode=3D4, context= =3D0xffd43284) at tablecmds.c:4455 #10 0x08302386 in AlterTable (stmt=3D0x1, stmt@entry=3D0x8d5d574, lockmode= =3Dlockmode@entry=3D4, context=3D0xffd43284, context@entry=3D0x1) at table= cmds.c:4101 #11 0x084f6ed9 in ProcessUtilitySlow (pstate=3Dpstate@entry=3D0x8e4dc04, p= stmt=3Dpstmt@entry=3D0x8d5d614, queryString=3DqueryString@entry=3D0x8d5ca5= 4 "ALTER TABLE parted_fk_naming ATTACH PARTITION parted_fk_naming_1 FOR VA= LUES IN ('1');", context=3Dcontext@entry=3DPROCESS_UTILITY_TOPLEVEL, param= s=3D0x0, queryEnv=3D0x0, qc=3D0xffd43580, dest=3D) at utility.c:1325 #12 0x084f5a28 in standard_ProcessUtility (pstmt=3D0x8d5d614, queryString=3D= 0x8d5ca54 "ALTER TABLE parted_fk_naming ATTACH PARTITION parted_fk_naming_= 1 FOR VALUES IN ('1');", readOnlyTree=3Dfalse, context=3DPROCESS_UTILITY_T= OPLEVEL, params=3D0x0, queryEnv=3D0x0, dest=3D0x8d5d804, qc=3D0xffd43580) = at utility.c:1074 #13 0x084f3c5d in PortalRunUtility (portal=3Dportal@entry=3D0x8dae354, pst= mt=3Dpstmt@entry=3D0x8d5d614, isTopLevel=3DisTopLevel@entry=3Dtrue, setHol= dSnapshot=3DsetHoldSnapshot@entry=3Dfalse, dest=3D0x8d5d804, qc=3D0xffd435= 80) at pquery.c:1158 #14 0x084f3dd5 in PortalRunMulti (portal=3D0x8dae354, portal@entry=3D0x8d5= d804, isTopLevel=3DisTopLevel@entry=3Dtrue, setHoldSnapshot=3DsetHoldSnaps= hot@entry=3Dfalse, dest=3Ddest@entry=3D0x8d5d804, altdest=3Daltdest@entry=3D= 0x8d5d804, qc=3Dqc@entry=3D0xffd43580) at pquery.c:1322 #15 0x084f4710 in PortalRun (portal=3Dportal@entry=3D0x8dae354, count=3Dco= unt@entry=3D2147483647, isTopLevel=3DisTopLevel@entry=3Dtrue, run_once=3Dr= un_once@entry=3Dtrue, dest=3D0x8d5d804, altdest=3D0x8d5d804, qc=3Dqc@entry= =3D0xffd43580) at pquery.c:791 #16 0x084ef82f in exec_simple_query (query_string=3Dquery_string@entry=3D0= x8d5ca54 "ALTER TABLE parted_fk_naming ATTACH PARTITION parted_fk_naming_1= FOR VALUES IN ('1');") at postgres.c:1235 #17 0x084f0fd7 in PostgresMain (dbname=3D0x8d83ad4 "regression", username=3D= 0x8d5a758 "postgres") at postgres.c:4497 #18 0x080f7de2 in BackendRun (port=3D) at postmaster.c:4486 #19 BackendStartup (port=3D0x8d7bd78) at postmaster.c:4214 #20 ServerLoop () at postmaster.c:1804 #21 0x0844dc7c in PostmasterMain (argc=3Dargc@entry=3D8, argv=3Dargv@entry= =3D0x8d58668) at postmaster.c:1476 #22 0x080faa8f in main (argc=3D8, argv=3D0x8d58668) at main.c:197 regards, tom lane