toast-ff-fix.patch

application/octet-stream

Filename: toast-ff-fix.patch
Type: application/octet-stream
Part: 0
Message: Re: fillfactor gets set to zero for toast tables

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/common/reloptions.c 10 2
Index: src/backend/access/common/reloptions.c
===================================================================
--- src/backend/access/common/reloptions.c	(HEAD)
+++ src/backend/access/common/reloptions.c	(fixed)
@@ -116,7 +116,7 @@
 		{
 			"autovacuum_analyze_threshold",
 			"Minimum number of tuple inserts, updates or deletes prior to analyze",
-			RELOPT_KIND_HEAP | RELOPT_KIND_TOAST
+			RELOPT_KIND_HEAP
 		},
 		-1, 0, INT_MAX
 	},
@@ -1156,10 +1156,18 @@
 bytea *
 heap_reloptions(char relkind, Datum reloptions, bool validate)
 {
+	StdRdOptions *rdopts;
+
 	switch (relkind)
 	{
 		case RELKIND_TOASTVALUE:
-			return default_reloptions(reloptions, validate, RELOPT_KIND_TOAST);
+			rdopts = default_reloptions(reloptions, validate, RELOPT_KIND_TOAST);
+			if (rdopts != NULL)
+			{
+				rdopts->fillfactor = 100;
+				rdopts->autovacuum.analyze_threshold = -1;
+			}
+			return (bytea *) rdopts;
 		case RELKIND_RELATION:
 			return default_reloptions(reloptions, validate, RELOPT_KIND_HEAP);
 		default: