v1-0001-Check-inserted-SpGist-tuple-fit-the-index-page-in.patch
application/octet-stream
Filename: v1-0001-Check-inserted-SpGist-tuple-fit-the-index-page-in.patch
Type: application/octet-stream
Part: 0
Message:
Re: OOM in spgist insert
Patch
Format: format-patch
Series: patch v1-0001
Subject: Check inserted SpGist tuple fit the index page in case there are INCLUDE columns more strictly.
| File | + | − |
|---|---|---|
| src/backend/access/spgist/spgdoinsert.c | 1 | 1 |
From 651046d28cd91c6c360fce7d64fe6402e5cfa768 Mon Sep 17 00:00:00 2001
From: Pavel Borisov <pashkin.elfe@gmail.com>
Date: Wed, 12 May 2021 12:35:03 +0400
Subject: [PATCH v1] Check inserted SpGist tuple fit the index page in case
there are INCLUDE columns more strictly.
---
src/backend/access/spgist/spgdoinsert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c
index 4d380c99f0..d363b90ff8 100644
--- a/src/backend/access/spgist/spgdoinsert.c
+++ b/src/backend/access/spgist/spgdoinsert.c
@@ -1989,7 +1989,7 @@ spgdoinsert(Relation index, SpGistState *state,
* If it isn't gonna fit, and the opclass can't reduce the datum size by
* suffixing, bail out now rather than getting into an endless loop.
*/
- if (leafSize > SPGIST_PAGE_CAPACITY && !state->config.longValuesOK)
+ if (leafSize > SPGIST_PAGE_CAPACITY && (!state->config.longValuesOK || leafDescriptor->natts >= spgFirstIncludeColumn))
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
--
2.24.3 (Apple Git-128)