Run a transaction block through SPI_execute

From: mahendrakar s <mahendrakarforpg(at)gmail(dot)com>
To: pgsql-novice <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Run a transaction block through SPI_execute
Date: 2023-11-23 13:03:32
Message-ID: CABkiuWqsfevi1-GzuNNeqjTMBHMN_HMUmHZOOQZBqLWcY9aU+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2023-11-23 15:47:45 Re: Run a transaction block through SPI_execute
Previous Message Simon Connah 2023-11-13 07:05:39 Re: I installed PostgreSQL 16 from the offical Fedora 39 repos - need PostGIS