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 1r69Mz-00HNNr-U2 for pgsql-novice@arkaria.postgresql.org; Thu, 23 Nov 2023 13:03:49 +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 1r69Mx-000TyM-MO for pgsql-novice@arkaria.postgresql.org; Thu, 23 Nov 2023 13:03:47 +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 1r69Mx-000Ty8-Bd for pgsql-novice@lists.postgresql.org; Thu, 23 Nov 2023 13:03:47 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r69Mu-006ydh-Pu for pgsql-novice@lists.postgresql.org; Thu, 23 Nov 2023 13:03:46 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-5cca68f6e01so8714947b3.2 for ; Thu, 23 Nov 2023 05:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700744624; x=1701349424; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=uMgv9pBZ1uRDwZAIPZzOT00F2tz8glQ73Z53LRRZ7Ns=; b=AYPB26SA40F3Ecdbws3WI7yB/LFt26kWklThBppI1Ywksu4COVI2ayoOyW/ysZh+8r Ju5iM08IuNK6/On0W/WDQj1nttn3gkBVoPw68z6CBh7BXfqxnqeCe0ntaRhm7LVyNncX E2/0R7EKZTK+L1m4e/s6XGUq4+vHf45OU4dFNCGckQ3lvhT9HmhB+yGaSAqU+Zd1+1KB fIpPf7ETiJjSnE5cTI+S5Tgj1DhLLN67Ig45duSWxSf/cqxfqscQ7aLd+V1+QjT82+Nh BRWfUOUCG4MUKBYMCmk+VhAyiepcBC6sR8buDX7/Y8Z6LCJxcdxLArxLWtfAoZZgW6u9 8RPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700744624; x=1701349424; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uMgv9pBZ1uRDwZAIPZzOT00F2tz8glQ73Z53LRRZ7Ns=; b=TScBmpBfb4YigStr73PWpfy0fSijSFjQuB2JTajpXh1ukAAo9UHKadLARUbW2TYm91 cGuXittPpSbG35mTXyC2RVs0/hqLlRYbdajiPwfPq53/PDE2s2J/sdQ9SU8AzwjXqfhb xaRN6NLxg868nt8mKZdtmPhaw7Jc1IgwHvAlZceofIOCTFSDDVjD32+LM24MK7SPk+hb 4salgSOzg8TuDrD6SxS5iJf3103hWF0Buu0lvcU5qedvLotgpBgpsTKWIZBS1WUf1+9T E0+THqLl+AJ/RHFQx955r6R0H4HdD6KB7DQKa8VK9ZA4PewbBHYXsbFlXfd7Lt21beuL TJ/A== X-Gm-Message-State: AOJu0YzT1OMaWwMVlzMyRJSRMgqEDbBwJF4VHgUJNJeiO7APwPw0AsGG jk84okUVucemqEdPAI1PmAWS8nKJNhp0BeSsZgGEjIBfrBU= X-Google-Smtp-Source: AGHT+IFBmarugwYkGm2+6kbFwRYyA5clircsoXFxEn8O6mDBG04tOPjX9iI654Ku1jCyOkw5TaeKGm9Mw4tDFZ1sb34= X-Received: by 2002:a81:b614:0:b0:5cc:c7c2:de54 with SMTP id u20-20020a81b614000000b005ccc7c2de54mr3558601ywh.27.1700744623683; Thu, 23 Nov 2023 05:03:43 -0800 (PST) MIME-Version: 1.0 From: mahendrakar s Date: Thu, 23 Nov 2023 18:33:32 +0530 Message-ID: Subject: Run a transaction block through SPI_execute To: pgsql-novice Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk When I try to run a transaction block (similar) to below through SPI_execute: BEGIN; set transaction read write; ....; COMMIT I get an error: SPI_ERROR_TRANSACTION. I see that SPI interface does not support transaction manipulation commands. Documentation: https://www.postgresql.org/docs/current/spi-spi-execute.html Can you please suggest me how to achieve run the above transaction block using SPI_ interface? Transaction management support only SPI_commit/SPI_rollback. I'm more interested in setting `set transaction read write;` through SPI interface. Thanks, Mahendrakar.