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 1t9T2Y-00ANAA-4D for pgsql-general@arkaria.postgresql.org; Fri, 08 Nov 2024 17:44:57 +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 1t9T2V-00Bg41-Er for pgsql-general@arkaria.postgresql.org; Fri, 08 Nov 2024 17:44:56 +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.94.2) (envelope-from ) id 1t9T2V-00Bg3t-3X for pgsql-general@lists.postgresql.org; Fri, 08 Nov 2024 17:44:55 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t9T2R-000t34-Ri for pgsql-general@lists.postgresql.org; Fri, 08 Nov 2024 17:44:55 +0000 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2e91403950dso1933400a91.3 for ; Fri, 08 Nov 2024 09:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731087891; x=1731692691; darn=lists.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=WUiMO0NFKhJ52Drpx7FLjOh2Q7vN4rhjulrqXPcCIlE=; b=YokbQAqTEsS6qLZ7N+mp3FVPOJWCjqUTvbMh41m9nWlomxyltS/Ju5LfLKmL2LhSRb a3rDCfUZwXpEK0T7EMhlPS4zOpbk4a+/gcNcOlGdnmYRiwSgF85JJFZImfesynEYLKyC DAmL/RisgfCte21gsaDqp5PKFd8IjGyfyoVrryIJBo5hfvABewyknW66hdrEfxG+7Zuv bCS4QC1fH9+lk8xnc+HxXnfej1ZjaRamKqBaUoTc6xVvDLD+bq5JDrHilMuGExaiayTt OnPimKyhXr9I91LSP4a8jUq3e2ZfS9672skDt3dhDmHjwEThpKtZVhbJIcNsk1Pr7v/7 EFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731087891; x=1731692691; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WUiMO0NFKhJ52Drpx7FLjOh2Q7vN4rhjulrqXPcCIlE=; b=ZrrcSOUq4KnRTeCW2M1ul1jGcYaEqfmiH84UXPU+KIvU5E8iWixlyF0hxk+J5VDoth br5g4wdiRIumVM5vafW5PJnM8txt7Dk1MeoKTcN3k/rHi7PxpW5VlOa6UXd0vPG96DlB Zwxle3lkhgvhliJwOMJTXC7bPMhR0+VaSc2qKCrZ/OYaZtB6hNsG9rAnxYI1iTp665wO tVmbTrLZtrcLwNLm/iq0DCJEfDLVKWlAOtKcNqQ/TWlO7CRGiAYtlD3oQWWQCsjBM68E I1H+iH8bG5Q9ZtatppIoean9qfaV5xW5AQeXAFpZBm2d2JTGIQohx+2GBAsx7m5Nxb2A 5w8Q== X-Gm-Message-State: AOJu0YyCZQleRGuzeCoeYmHm1HArtyzwr3JNc/3iVFgacSCO9ILK2gkI q41yu8Ibuf2vA8vPZHaC+aHlN7MzRZJb1zC8CX/eV3iYdMeaFztWvQWWx15u8M9ZkMbVMyUZZVJ b6tUJ1b5LmN6Wuad2d4X6JGlN59/Wtg== X-Google-Smtp-Source: AGHT+IGcJHNKWzzb8IVKxfUJomK9yUlSh/ocxfHru84+wY8KFv4hXh2+sjj0n0tJzx9xh2Hgl55z7OSJjD38mCgiPMs= X-Received: by 2002:a17:90b:54c4:b0:2e9:4717:97a8 with SMTP id 98e67ed59e1d1-2e9b1793de9mr4559409a91.36.1731087891270; Fri, 08 Nov 2024 09:44:51 -0800 (PST) MIME-Version: 1.0 References: <3628359.1731076788@sss.pgh.pa.us> In-Reply-To: <3628359.1731076788@sss.pgh.pa.us> From: =?UTF-8?Q?Micha=C5=82_Albrycht?= Date: Fri, 8 Nov 2024 18:44:40 +0100 Message-ID: Subject: Re: Why plpython functions increase transaction counter much more then plpgsql functions? To: Tom Lane Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d5a30206266a4efd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d5a30206266a4efd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > A quick look at PLy_spi_execute_query shows that it runs each command > in a subtransaction. It pretty much has to, because the coding rules > for a Python method don't permit it to just longjmp out of the Python > interpreter, so it has to set up a subtransaction so it can catch any > error. In this example, each subtransaction will consume an XID. > > That makes sense. Thank you very much. Regards, Micha=C5=82 Albrycht --000000000000d5a30206266a4efd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
A quick look at PLy_spi_execute_query shows that it runs= each command
in a subtransaction.=C2=A0 It pretty much has to, because the coding rules<= br> for a Python method don't permit it to just longjmp out of the Python interpreter, so it has to set up a subtransaction so it can catch any
error.=C2=A0 In this example, each subtransaction will consume an XID.
<= br>
That makes sense. Thank you very much.
Regar= ds,

Micha=C5=82 Albrycht=C2=A0
--000000000000d5a30206266a4efd--