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 1mSM4C-0005f3-EU for pgsql-sql@arkaria.postgresql.org; Mon, 20 Sep 2021 16:22:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mSM4A-0004pK-Gv for pgsql-sql@arkaria.postgresql.org; Mon, 20 Sep 2021 16:22:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSM4A-0004pC-6q for pgsql-sql@lists.postgresql.org; Mon, 20 Sep 2021 16:22:50 +0000 Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mSM48-0006wC-68 for pgsql-sql@lists.postgresql.org; Mon, 20 Sep 2021 16:22:49 +0000 Received: by mail-vk1-xa34.google.com with SMTP id t19so6751878vkk.2 for ; Mon, 20 Sep 2021 09:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pNTME5Cron3SDQBsfvKm7d3Gb8IR/PxqKBZ5tJYL7jE=; b=flCTwF3YfCzVimQNrXnkuN49KQHu+JpSq0FwiqUgvaTlgkNul0a/RMusFcADgBbf8p dMEGyg8plJd2XD9NcO4B9SHnt8fJ9bnZBcmBvqCuO4CBJruYKnm48H9FXdfPY4WAgpLx D7YiQe0bGF8zAGOKGeaFsf3//a4KcjCmUHX2sdBQ6v4APM/Rh7dbpNCUsY7XY3YGHoGy 6Hxr8KUPgr5MniVxkkxUqMWEQ2nod/tAgAtJVH0KH49k7Wk3CD8V784HC/m6U8Xczaii IECYFyRHEAkpWoTh6QgNtDAbgU9MF9Yp5An9Ukeqt+s56/g/j/5RPHN8cHwITWclA8yM c3Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pNTME5Cron3SDQBsfvKm7d3Gb8IR/PxqKBZ5tJYL7jE=; b=SOgIXKrjgutc2JEP4sFzeieV0PRTaTYbro4CgWANOX7REX0+tk2/x8XM97jts1xcV8 zOqdhwdJWpa0JUzdydURARK1GkYgNa61nby812YfbllQpfeXg+uwECw+FVwrDTlfGLZy mv/QwPHG3Zv5kYCAJU49Drhc/eYqyonsDQdi2Ts94GZNi9RfICyxsr8E7c6PB9VBFgoQ FNbzgaz99b6vbshVg7iOY9OBXh7PBEbPTA7qLNnJJF0CFMGMXT/fjuWPq7KtHmYqoCKK A35mgrvKiaKlKosqvl4a38EadmgLvfiQy2fnGf38WkE+fiTAe0VpNICSZ6LWDSJbhMVS ioKA== X-Gm-Message-State: AOAM530akczMsIYIyBWlcUD1x2JfVKsoXGO98fxER/1Od0A/c+D4VCUV i0xT4ELN6hzID0+zmW1FxsMrJIH9uGn7rEK9Bxc= X-Google-Smtp-Source: ABdhPJy2ftGsl6k5dvn/ALwTMBIROhlZ07TFmRb2HmidS2aYbMeL3wZBGdkHrT5hiyrDhAp5rb8UInyWAj2IllqIxkk= X-Received: by 2002:ac5:cfed:: with SMTP id m45mr15312524vkf.2.1632154966781; Mon, 20 Sep 2021 09:22:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Mon, 20 Sep 2021 09:22:30 -0700 Message-ID: Subject: Re: How to sort deleted rows with trigger. Some rows before then some rows after. To: intmail01 Cc: Rob Sargent , pgsql-sql Content-Type: multipart/alternative; boundary="00000000000003736505cc6fb150" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000003736505cc6fb150 Content-Type: text/plain; charset="UTF-8" On Mon, Sep 20, 2021 at 8:54 AM intmail01 wrote: > > How to use transaction in a trigger ? It seems there is no possibility to > control transaction within function > > You cannot. You don't get to introduce a transaction boundary in the middle of a statement's execution. Not to mention what it would mean to have transaction boundaries for deferred triggers. David J. --00000000000003736505cc6fb150 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 20, 2021 at 8:54 AM intmail01 <intmail01@gmail.com> wrote:

How to use transaction in a trigger ? It see= ms there is no possibility to control transaction within function

<= /div>

You cannot.=C2=A0 You don't= get to introduce a transaction boundary in the middle of a statement's= execution.=C2=A0 Not to mention what it would mean to have transaction bou= ndaries for deferred triggers.

David J.
=
--00000000000003736505cc6fb150--