aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-07-18 16:23:48 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-07-18 19:33:46 +0200
commit9af9e2094dcf16fdff538ce271c33a502e88a160 (patch)
treeb0fada184c91a6563e6c09cc0dd8a061289d4635 /src
parent288e499ba817ccb364b9bc826a4470f03ca23b72 (diff)
downloadpostgresql-9af9e2094dcf16fdff538ce271c33a502e88a160.tar.gz
postgresql-9af9e2094dcf16fdff538ce271c33a502e88a160.zip
Re-add SPICleanup for ABI compatibility in stable branch
This fixes an ABI break introduced by 293f5c5f496cd8ce87c65b393613da675fc0bb8d. Author: Markus Wanner <markus.wanner@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/defd749a-8410-841d-1126-21398686d63d@enterprisedb.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/spi.c10
-rw-r--r--src/include/executor/spi.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 308e74fc0b3..5f9e0e31113 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -417,6 +417,16 @@ SPI_rollback_and_chain(void)
}
/*
+ * SPICleanup is a no-op, kept for backwards compatibility. We rely on
+ * AtEOXact_SPI to cleanup. Extensions should not (need to) fiddle with the
+ * internal SPI state directly.
+ */
+void
+SPICleanup(void)
+{
+}
+
+/*
* Clean up SPI state at transaction commit or abort.
*/
void
diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h
index 7741dfbca88..7bf361874d2 100644
--- a/src/include/executor/spi.h
+++ b/src/include/executor/spi.h
@@ -164,6 +164,7 @@ extern void SPI_commit_and_chain(void);
extern void SPI_rollback(void);
extern void SPI_rollback_and_chain(void);
+extern void SPICleanup(void);
extern void AtEOXact_SPI(bool isCommit);
extern void AtEOSubXact_SPI(bool isCommit, SubTransactionId mySubid);
extern bool SPI_inside_nonatomic_context(void);