Skip to content

Commit ee678fe

Browse files
committed
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.
1 parent d1e0272 commit ee678fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/commands/async.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.151 2010/02/16 22:34:43 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.152 2010/02/17 00:52:09 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -137,9 +137,12 @@
137137
/*
138138
* Maximum size of a NOTIFY payload, including terminating NULL. This
139139
* must be kept small enough so that a notification message fits on one
140-
* SLRU page.
140+
* SLRU page. The magic fudge factor here is noncritical as long as it's
141+
* more than AsyncQueueEntryEmptySize --- we make it significantly bigger
142+
* than that, so changes in that data structure won't affect user-visible
143+
* restrictions.
141144
*/
142-
#define NOTIFY_PAYLOAD_MAX_LENGTH 8000
145+
#define NOTIFY_PAYLOAD_MAX_LENGTH (BLCKSZ - NAMEDATALEN - 128)
143146

144147
/*
145148
* Struct representing an entry in the global notify queue

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy