Commit ee678fe3 authored by Tom Lane's avatar Tom Lane

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.
parent d1e02722
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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 @@ ...@@ -137,9 +137,12 @@
/* /*
* Maximum size of a NOTIFY payload, including terminating NULL. This * Maximum size of a NOTIFY payload, including terminating NULL. This
* must be kept small enough so that a notification message fits on one * 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 * Struct representing an entry in the global notify queue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment