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.94.2) (envelope-from ) id 1txZW2-00BP9i-It for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 22:46:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1txZVz-00Bymz-DL for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 22:46:27 +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.94.2) (envelope-from ) id 1txZVy-00Bymr-NL for pgsql-hackers@lists.postgresql.org; Wed, 26 Mar 2025 22:46:27 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1txZVv-001Jtv-1s for pgsql-hackers@lists.postgresql.org; Wed, 26 Mar 2025 22:46:25 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-22580c9ee0aso8616095ad.2 for ; Wed, 26 Mar 2025 15:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1743029183; x=1743633983; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=6ElB8lbRuPmOBTzHtxCRsK2Oji0jiYN+m74urfSOJDA=; b=rIQ0sm630/0gIP1ubt0TyVw+RpxTrwISgJEZ/g1tVAAAaxh/YwzUp/fv1c0PwIIH9c KrL8wm9shsQXg9hAEC6cn61Uc9aOs0MtuFTbZbqZgxMM4xAiuaQEAjZN35FMgFh4rBkW TrVZnX/dL6OKaw0HZ4/MIqE97e/hid6nt2CwA4psXR/3XIjHQkmF/tnBVQ4eEhBmx/M3 GjDnXqqUJfCIz+PjRh+5w/kvvLrFH/9W9hOArrukMVdi3TyEzxfzcpEzKDvJWE3xHDIZ 43YSSWBnwV9MppzvC1CIfxS3mO7AKmrmHdY4NzRcE0Bs1xzoXFyjQOMKZU7BjJoBziBW zDQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743029183; x=1743633983; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6ElB8lbRuPmOBTzHtxCRsK2Oji0jiYN+m74urfSOJDA=; b=p6uD8SKSdGzVL3Cbaq74DVMN9EiGvxw3zNZzfVylJOxFcF4UTb4WTnvwxT/icCYHZV S9kHHrRC+hpMV1geORLTSGD2V3xjTsOUWqW6BMo2shberU6HmoKCWNL4h5J+olr2BZP1 gV6Vy7cYlm40VL6nfpPeVwYjopYchdNkrvc73pN0TClVkeZ7fjbQtp2Vyz/jqGfH0374 gg+EGIQQwwAZ2KzsaMxnIGQ7odFD39uH9JucEbkgrW6MF2elFxkSRDG6WXdgftQfUKzz Cl369EHixdmr/HzT2W/vP+20d1SBG1y6APEko2D1zjJN+MBuQqB4pZZ9X3L+19K5eZF2 Qe/A== X-Forwarded-Encrypted: i=1; AJvYcCXYoP1/OUYNaRNUVtkf6lUDmf5prgDIrR13G/XaSqIg9y+U+GVaxSR5u7y7oIyU8hEbDeW13rl91zKyvMwm@lists.postgresql.org X-Gm-Message-State: AOJu0YxzMuEUR5c/kXYaa2HUYtBvf4QeleN8Qp8qywBEGNqCJZIGGgBC m2epBhzNSn2460lEqnKuZNBz2GhXvS60NhpyE0HlOR9Jb03hnv9PALn2gxl1t5E= X-Gm-Gg: ASbGncuxwoBFdStRZ1HvBoxY7Y2hIHwjMFxZbS4LD4qUYvYCR4OLEHgNF2q93S6ZxDv sD9mPJxVvKf9yVd3RKm4w8KD5vyqR2xGBP8BXfCfk5pzbGT3d6nRZb/b0cJyK/qHexqAR8ypfXh K4gZ164J+5ybVAU/l3LDeawACeyBeZ2Vp8a/x5dR/l5deJwDvpITFWt66c7zfQKmRXnA207JREe e7YXe2xHThmUJBjrxeZWlF685YDYQhFMQQWXb3NrxBtnsI2B+2sC9+4MooISQ/yn4pSx26AKdbl uGrrgDgdcASQYN0u4LhFFLDt0oXgrAAA3/v8TFtZzji4c+fKt4xkDjVhexx2DzwTE4FW8QTZnCL ApUJ74xAfoFsBGN3KIk+uNwKZ X-Google-Smtp-Source: AGHT+IFOpG8CDsGv9QrQRPM36aSvxeBaWd6H6U4ogDJj4O/agpHNs+oxVIHXg21hMbDk6S6BX8EhhQ== X-Received: by 2002:a17:902:ce06:b0:223:54aa:6d15 with SMTP id d9443c01a7336-22804850b72mr24764325ad.12.1743029182583; Wed, 26 Mar 2025 15:46:22 -0700 (PDT) Received: from [192.168.0.102] (204-195-12-230.wavecable.com. [204.195.12.230]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-227811f44bbsm115019995ad.232.2025.03.26.15.46.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Mar 2025 15:46:21 -0700 (PDT) Message-ID: <766da800-4884-41a9-8e8e-71d131dc599c@illuminatedcomputing.com> Date: Wed, 26 Mar 2025 15:46:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [fixed] Trigger test To: Dmitrii Bondar , PostgreSQL Hackers References: <79755a2b18ed4fe5e29da6a87a1e00d1@postgrespro.ru> <7879fede654a17b9fcc8548de2cb3f69@postgrespro.ru> <174293570374.60294.13024599409215069922.pgcf@coridan.postgresql.org> <17a8a24f7295201873d105c5118024f5@postgrespro.ru> Content-Language: en-US From: Paul Jungwirth Cc: Lilian In-Reply-To: <17a8a24f7295201873d105c5118024f5@postgrespro.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Dmitrii, Thanks for the quick update! On 3/26/25 02:45, Dmitrii Bondar wrote: >> 3. Consider updating documentation for doc/src/contrib-spi.sgml, or any file as appropriate, to >> reflect the changes. > > The changes have now been added to doc/src/contrib-spi.sgml. I also added a consideration note about > interactions with BEFORE triggers. This looks good. I have a couple small grammar suggestions. This: + To use, create a AFTER INSERT OR UPDATE trigger using this should be: + To use, create an AFTER INSERT OR UPDATE trigger using this and this: + To use, create a AFTER DELETE OR UPDATE trigger using this should be this: + To use, create an AFTER DELETE OR UPDATE trigger using this Also re this part of the patch: @@ -592,10 +598,15 @@ check_foreign_key(PG_FUNCTION_ARGS) } else { + const char* operation; + + if (action == 'c') + operation = is_update ? "updated" : "deleted"; + else + operation = "set to null"; #ifdef REFINT_VERBOSE elog(NOTICE, "%s: " UINT64_FORMAT " tuple(s) of %s are %s", - trigger->tgname, SPI_processed, relname, - (action == 'c') ? "deleted" : "set to null"); + trigger->tgname, SPI_processed, relname, operation); #endif } args += nkeys + 1; /* to the next relation */ We can put all the new lines inside the #ifdef, can't we? > Can you also help me with the patch status? What status should I move the patch to? I think if you make those changes we should mark this as Ready for Committer. Yours, -- Paul ~{:-) pj@illuminatedcomputing.com