aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-17 00:52:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-17 00:52:09 +0000
commitee678fe30c3b9088f0ed956eb33c37f15a429932 (patch)
tree5f863171374c15c898bbc8f3749b5cc4ddf26f34
parentd1e027221d0243b7b57eabb0e482923dd7d1c8eb (diff)
downloadpostgresql-ee678fe30c3b9088f0ed956eb33c37f15a429932.tar.gz
postgresql-ee678fe30c3b9088f0ed956eb33c37f15a429932.zip
Make NOTIFY_PAYLOAD_MAX_LENGTH depend explicitly on BLCKSZ and
NAMEDATALEN, so this code doesn't go nuts with smaller than default BLCKSZ or larger than default NAMEDATALEN. The standard value is still exactly 8000.
-rw-r--r--src/backend/commands/async.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index f5863480f5e..23c57cea044 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.151 2010/02/16 22:34:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.152 2010/02/17 00:52:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -137,9 +137,12 @@
/*
* Maximum size of a NOTIFY payload, including terminating NULL. This
* must be kept small enough so that a notification message fits on one
- * SLRU page.
+ * SLRU page. The magic fudge factor here is noncritical as long as it's
+ * more than AsyncQueueEntryEmptySize --- we make it significantly bigger
+ * than that, so changes in that data structure won't affect user-visible
+ * restrictions.
*/
-#define NOTIFY_PAYLOAD_MAX_LENGTH 8000
+#define NOTIFY_PAYLOAD_MAX_LENGTH (BLCKSZ - NAMEDATALEN - 128)
/*
* Struct representing an entry in the global notify queue