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 1vNSmv-003Iio-06 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 09:23:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNSmt-0002QH-27 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 09:23:11 +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 1vNSmt-0002Q2-1B for pgsql-hackers@lists.postgresql.org; Mon, 24 Nov 2025 09:23:11 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vNSmr-001CWf-1s for pgsql-hackers@postgresql.org; Mon, 24 Nov 2025 09:23:11 +0000 Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4ee1fca7a16so35271351cf.3 for ; Mon, 24 Nov 2025 01:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763976187; x=1764580987; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1d1Utz6PhAU6CUEl1ErMHtNt5p3fBVl+/M9mJI5TKlA=; b=HinVSrU1bRECqnEtkpKmrLJLUJ8b1JcUmiKrOB0xqlZDLO8ZGE/AhAt/pWcmCtMbgM dLzhIkSCuVGJi9G5L12RsYAUBOJnlG4XTmwCOmSZ3JupeZOihT3N7WpjVLTq1XPGQpFj PvHE3o5+05KdD+v5vBc32XyIICUNnWEbuEOFkV3xTNVBOApn5sNWJNmNYaDjfAeEhgPn ST75MkECC5dc2hGjesQawpbphfcJCncbfPgnbQRkFKZ1qhhhcCkQLHUB3CkOzx3O0Dvl B/HEE3Dv/CAT6kMdKipWm5e1BWnCPoEnf8ow1zw7If5BtHFCGzMbNEmyihcFkgq8JyFJ Xetg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763976187; x=1764580987; h=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=1d1Utz6PhAU6CUEl1ErMHtNt5p3fBVl+/M9mJI5TKlA=; b=eCprVhGURm2dnrx9DZUtaZNYHopl1P3fliBauYQiHx95gFG2tsdM8QTNVAfMvVqpJi eQTeslr/s7eZtBwsy2UurDIGHWRwjcuEAHzFEyLzao060BeBmA3JA6n5NMUe/oIXrdrD 0rvdquq4rzv2k8c1UINSMiDFAWGblhy7eak7rLydv3IEtggc9xbi9SMHcZplGV7wcD/J H6gi/BTJDJS6R1DpohYA3Yoo2xvTle7i0Kxq9BnKH8nF1h4EdVRojxPM0QeMj+ZQgmFe YhQtGiGIdRpG+P3dxi0CQmZAuAPZCaJLPKqOojUx/5KCAEk91uX4S+fnwWtd8LqOIQeU bR1A== X-Gm-Message-State: AOJu0Yywpm98Ks+Ra+wfhLEMvuG7Tv27DR9CyGBmcjsouQWMJbjQ+lPn L5dX4+EFWDcb50uR+p5QdCm4vPnYC2HmjinGXziv99XCBHePIWv40Phx28JJoqCP7cbcfaof/by jknG89klFnOS+L+27v9JZ/MFGJdUIYblXmA== X-Gm-Gg: ASbGncvvKdyAxXfhTnY4eK0wbqBlciM781QoNsBz8UAQnXLov9aZKFI7tD2pbEd3XUN 3MeCZHEruVfCY31pQAGBjUCue9j0i003WMKMKicP4bzG53Ifbmr5GRl7SIAv6qmn+2vm58x2Uyb V2spWsDS62wOKEevCZYBoHVj7HAsva/4p+YccXjAEaa9UY0lZN3Wm5pnLAD7cowzPdmLJ6V9XsN i97/GXrUg9G57hE7HV2kXDrlAiBXkrODdnb20IplDLjgzmxJEofNnHIO2QdiZ87inkaSJAd51oj +OPGYAA= X-Google-Smtp-Source: AGHT+IHHSZuGb6mxdXJbgZ3JMiOgX8Ba23bWq++W6fyqjw7+eGyHU8bbNvxBlmznhRjxFB8cQQL6g1aphmRHMeQYVgk= X-Received: by 2002:ac8:5a46:0:b0:4ed:a6b0:5c39 with SMTP id d75a77b69052e-4ee588b51c8mr130081541cf.63.1763976187115; Mon, 24 Nov 2025 01:23:07 -0800 (PST) MIME-Version: 1.0 References: <20250331212648.ad4ab804559001d7f0788741@sraoss.co.jp> In-Reply-To: <20250331212648.ad4ab804559001d7f0788741@sraoss.co.jp> From: Kirill Reshke Date: Mon, 24 Nov 2025 14:22:56 +0500 X-Gm-Features: AWmQ_blOTFmMXNhrZDHpsyBillW7H5r9s-kc1Wtp0e5Ba8ScuIQEI7UaCOPljk0 Message-ID: Subject: Re: Add comments about fire_triggers argument in ri_triggers.c To: Yugo Nagata Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 31 Mar 2025 at 17:27, Yugo Nagata wrote: > > Hi, > > SPI_execute_snapshot() has a argument called "fire_triggers". If this is false, > AFTER triggers are postponed to end of the query. This is true in normal case, > but set to false in RI triggers. > > This is introduced by 9cb84097623e in 2007. It is aimed to fire check triggers > after all RI updates on the same row are complete. > > However, I cannot find explanation of"why this is required" in the codebase. > Therefore, I've attached a patch add comments in ri_trigger.c for explaining why > fire_triggers is specified to false. > > SPI_execute_snapshot() are used in a few places in ri_trigger.c, but I added > the comments only in ri_PerformCheck() because SPI_execute_snapshot() are used > only for SELECT quereis in other places. Therefore, I wonder fire_triggers is > not needed to be false in these places, but I left them as is. > > Regards, > Yugo Nagata > > -- > Yugo Nagata Hi! I checked your patch and I agree that your comment makes things more clear. Your patch LGTM -- Best regards, Kirill Reshke