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 1mGJOg-0005oO-VW for pgsql-docs@arkaria.postgresql.org; Wed, 18 Aug 2021 11:06:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mGJOf-0006zI-QP for pgsql-docs@arkaria.postgresql.org; Wed, 18 Aug 2021 11:06:13 +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 1mGJOf-0006z9-GM for pgsql-docs@lists.postgresql.org; Wed, 18 Aug 2021 11:06:13 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mGJOb-0005PG-78 for pgsql-docs@lists.postgresql.org; Wed, 18 Aug 2021 11:06:13 +0000 Received: by mail-wm1-x330.google.com with SMTP id l7-20020a1c2507000000b002e6be5d86b3so1512625wml.3 for ; Wed, 18 Aug 2021 04:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=fRo2zKt+kRpoQRFaUfyfjD4gIclw12nBHJXldpxzBNw=; b=VxDWH0gPEdJRF4yq6d0vHRVDc2340BEyttgeLCTr1q5hC1WFKI7bAaXSyFuUut2x4v OjjWSLH0kuf+b6j0GlHQN/HT43JvlGOhJVt8mh/9eUIbb5mwBLHtCCP3UI7NRrK3Bhd2 4CWbXYkkAmblJGf7uiwwUUe+NQKXYiV7lVUqht+LI/l33EiAY/beK628paT5WEx6Lnbg w2kYqed21qOh1AW/b7RsZzBu3TKr/qemI5N2Jlr64giT7CDVgYwnVLIR86vXZHtWkBTh YLPkwGLS9YgSj56Vn98QUTrm25I0kE/HPnq8cfuJjveDZ9CMxgIO4/JV6PtfqjqpDBSm f5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=fRo2zKt+kRpoQRFaUfyfjD4gIclw12nBHJXldpxzBNw=; b=bMG/BjuYOHnvtd7eXQrFN+w2XbtnYtd5HfJDxv5a4EJXMrAlWYCVhDRu0tOi+ve4/x 8zLYdxUz7uOe77v/CX0yAR+lIT9mXODx0P9EJxaBDJn+hsnQZB3VOR5EaY3PlC69n8GA H0SgdfS6v+GNJNPYZKxRBc4QHrLW7InQRPWggP1v/VmDAYFG0QLxMXyex3vyOmnEQskg /iYM3sWcn9VoAbuUkuTFNQfPhLkMU1OV/9q1aFWdg/19BaPxC7HK8srZ8xrofMcH/NpO tYTvNlyNcpXU937mrG2IF9b0QyixUUKMgCOAypW9TNzxc4SkbnKbjl4j0khaPWzO26h2 Hx/g== X-Gm-Message-State: AOAM530ySnCD/+VYqigxj23kNiWpnjvY0BijQ5YZxs6JfKwH9icR6foS +9ZjRJ/8O70mjkngHD9SzDE3tw== X-Google-Smtp-Source: ABdhPJwSIwAaAW+MlWz00Sm10EzNNDLKX8TXGmHpKVPJwdb8yxhlpinLRhZta1DtRtEajSadBZuz6g== X-Received: by 2002:a05:600c:4f85:: with SMTP id n5mr7848142wmq.146.1629284767035; Wed, 18 Aug 2021 04:06:07 -0700 (PDT) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id l9sm5316526wrt.95.2021.08.18.04.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 04:06:06 -0700 (PDT) Message-ID: <740c8d600cac5b816f8351dbc47b7e457260ed48.camel@cybertec.at> Subject: Re: Clarify how triggers relate to transactions From: Laurenz Albe To: Tom Lane Cc: him@nathanmlong.com, pgsql-docs@lists.postgresql.org Date: Wed, 18 Aug 2021 13:06:05 +0200 In-Reply-To: <1120625.1627676423@sss.pgh.pa.us> References: <161953360822.695.15805897835151971142@wrigleys.postgresql.org> <1a565681fe54535d69e6418ef5ab55405b92beac.camel@cybertec.at> <62219f2ce78faf09687d998f347c518b3c08d067.camel@cybertec.at> <1120625.1627676423@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-07-30 at 16:20 -0400, Tom Lane wrote: > Laurenz Albe writes: > > On Wed, 2021-04-28 at 13:24 +0200, Laurenz Albe wrote: > > > On Tue, 2021-04-27 at 14:26 +0000, PG Doc comments form wrote: > > > > If I understand correctly, it would be helpful to add this sentence or a > > > > corrected version of it: "Triggers always execute in the same transaction as > > > > the triggering event, and if a trigger fails, the transaction is rolled > > > > back." > > > > Here is a proposed patch for this. > > I think this is a good idea, but I felt like you'd added the extra > sentences in not-terribly-well-chosen places. For instance, your > first addition in trigger.sgml is adding to a para that talks about > triggers for tables, while the next para talks about triggers for > views. So it seems unclear whether the statement is meant to apply > to view triggers too. > > I think it'd work out best to make this a separate para after the > one that defines before/after/instead-of triggers. How do you > like the attached? That is better, and I like your patch. Thanks! Keeping paragraphs short is a good thing. Yours, Laurenz Albe