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 1w5vEf-003lQV-25 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 00:39:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5vEe-006oPL-02 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 00:39:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5vEd-006oPD-2M for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 00:39:36 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5vEc-00000001ELy-0rDe for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 00:39:35 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2b0c8362d93so5996895ad.3 for ; Thu, 26 Mar 2026 17:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774571973; cv=none; d=google.com; s=arc-20240605; b=FrAk1lSpgVCQs/APpCFB+jRy9mMRnfXMvsu/H+JjOnAopys7UorZZouqs50wBIt0yM 04NJXW46sEJeJ1E5Z2ua92mFcFkdLxglHzS1YyD275vtp+zaNZnnJaoPVaxqkBWS/Xt5 tnRrRenuNKSzJRxfPSah5C41w8PkULZLez7k8pVxqZRNuiypHmcK4TTkLEbnyXt3lp/q u1ORG45874iGdUzF1erlOqjLTwtNW6kUwvjxWe/x1kbUiYJA8V0KaJ8P665UPCR8FJeg WHUzAAod9XeSs6alL+xmunVqJXDVKGQKbnIg00xhDTBGIFsg7RnELAU8twabeNdnDmUo cAmA== 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=hLOJRuK4sLx1BstCD9wFfhbWk0bA7sumAjkrPsZ5iiM=; fh=jADxWBELqNw/efj9x086lujZ3R8StUAxIYOq/kXCU70=; b=d4hYejYp4mp38Pc02mSnDV0rBuzzA8bM5K8lcwRKOrSUblwdSNoUXmyRrCsuTx0GJm aWHaGRERq+azFPPgZswQRwECFoOrX7xHPUaSq+gviHVx6t1I8kNfk8or0268s3K+Xctu kdAQ5+bmeQvolCwJW9E5cS98tPY21LaG0ef/7JXGetbw5DGPGuep+AmYoBIaLcJ8RMOY /7vv8yOkIU9AA2/cDurceuCVLPvY+t8jiLAlpY5S3WgQtwKYTGwijRgDYyzlae7K1hq6 4bikE3Jxt49o32qIOABpnOL9CUQXcdB/z1Tizeakt0rW49aEWyXwtoB30suTMsFe1AUo gPbg==; 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=20251104; t=1774571973; x=1775176773; darn=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=hLOJRuK4sLx1BstCD9wFfhbWk0bA7sumAjkrPsZ5iiM=; b=n/SLjThvRBXpPvmvF048ABqfrMJEemuFBK0wyX6gvlX6NGyHJHwFmUQyDaEu5Uy4qa vcULLzSvylMM4G/1UaxuWFnDqs+qFpKewr2YAuAraA61APw8RIfl5NDhfnLcjDf56YZE iHO8sEQO3I36hActB1eztIZACmAZG/RroL/kreOsinxhrv1eQTOHSlrwZ/4krcP9O7zj mRoBnJV7HBxGUQlIZ1sKJDVwKhutYSEtLDtfWoyUE42YKsK4d8Pwz2slaJIobkMW59tZ cZQECN8Dufs7eX8svlsJUCKF7mEvVtjza3S6VYqbzXUjYUZ52+GgQ6oCtLJH3/dVdipg x8Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774571973; x=1775176773; 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=hLOJRuK4sLx1BstCD9wFfhbWk0bA7sumAjkrPsZ5iiM=; b=M+ErckFuWal+/IAcDfIZHQCgQQbxNVL99JdvkF6Uz/tBCGLSyPd0qvyRaTOxBRVQR5 uMLIOhc7Ag2Y+bspecfO8RZNcOsWkDXFUpomaA5lF1+8OQIRGSr1ebF/NnQIl3+t5idE 5k43M2Yn7pPOxAnYQldGxt0tfqBa+52JQBx6jDA6TuY0tGTGGXiuFvtRjBG6kqilcjPt CyhUHjnytRd8lDPGHPivUI9zsO+xFF3bH59AMqjgzEd7bF8l1+Tp16XbJ9Ri6j0btUS1 hCQeOj9eUKxpP96fbkLPKAm8t6BIVNIVDBIECY3y6MZlXSPEOZ6ilj7KwGHwcaCEU1bT Hc5Q== X-Forwarded-Encrypted: i=1; AJvYcCXCA9iHdGRBNZYm3JoYI/nQUOzUH6feI0z3Y9dkVK7UpR3oErFSPYloCTNaxQQmcVMTp/ZL28obtpDTI1MD@postgresql.org X-Gm-Message-State: AOJu0YzUVAeQS/iyaZSOdo40ThEkFpNzqW8q1GKJuVqruCvxpv3YJAHX kt8ilhhre1EUT8Wmnz6bZXFJyG41tosbZwE68clvrbbgXP4nPAI8x4aMVJ0ETQXPN6SjAeppSnb heyq7aMShWYoQANxQTk2tDQvPoL3E7tY= X-Gm-Gg: ATEYQzxWIwB0yr1d6P+3k96O3buP0LYFrOeFjATPp/8GRrQMez6lNZocU8dKX5Wsj9k kWY2v3z/oo+IeCPb2gFPY24bNlsFVt9bt+ZQl5iNPQUWt/MBb9ZashxPdJe9khXwl15fAZBvXYJ kkp/AYKHVJ/x3aerVEm9FF9ZvfbKYN9Vwfj081lACHPjPRk0SL40LeiiS7TcpaU+7u28elxZNl5 /9sqiPVDJ/4b1004o/WlZsbX3xrps3+47orOZ/kQQtG5GQ5BDROM1QLPYB0NsBVIHzqP7YtuUwu zfmXNoX6 X-Received: by 2002:a17:902:ce12:b0:2ae:54b2:27c7 with SMTP id d9443c01a7336-2b0cdcca420mr6021765ad.39.1774571973259; Thu, 26 Mar 2026 17:39:33 -0700 (PDT) MIME-Version: 1.0 References: <20250331212648.ad4ab804559001d7f0788741@sraoss.co.jp> <20260327005646.8b9df4658b2dd510d3f95ec0@sraoss.co.jp> In-Reply-To: <20260327005646.8b9df4658b2dd510d3f95ec0@sraoss.co.jp> From: Amit Langote Date: Fri, 27 Mar 2026 09:39:17 +0900 X-Gm-Features: AQROBzB4c8HGUCk1dX-X657jSL8qsHlAuDTnJpa72mADLqSwJpm74Qccn7Gp2OY Message-ID: Subject: Re: Add comments about fire_triggers argument in ri_triggers.c To: Yugo Nagata Cc: surya poondla , pgsql-hackers@postgresql.org, Kirill Reshke 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, Mar 27, 2026 at 12:56=E2=80=AFAM Yugo Nagata = wrote: > > Hi, > > Thank you all for the review and comments. > > > Yes Amit, I agree that SPI_execute_snapshot() comments do provide some > > context on AFTER triggers, but I still feel the newly added comment > > in ri_PerformCheck() gives additional context on why the fire_triggers = is > > set to false. > > Yes, that is what I intended. The existing comments on > SPI_execute_snapshot() explain how the fire_triggers parameter works, > but I would like to add a comment explaining why the AFTER trigger for > RI needs to set it to false. > > If the explanation of the effect of fire_triggers seems redundant, I am > fine with the following shorter version: > > + * Set fire_triggers to false to ensure that check triggers fire = after all > + * RI updates on the same row are complete. Thanks for the updated patch. Yes, adding the comment might be good, but I'd suggest a small tweak: + * Set fire_triggers to false to ensure that AFTER triggers are queued in + * the outer query's after-trigger context and fire after all RI updates on + * the same row are complete, rather than immediately. Two changes: * "check triggers" -> "AFTER triggers", since fire_triggers=3Dfalse affects any AFTER triggers queued during the SPI execution, not just RI check triggers. * mention of the outer query's after-trigger context to explain the mechanism by which the deferral works. Does that additional context help? --=20 Thanks, Amit Langote