{"Entry":{"collection":"guc","key":"max_notify_queue_pages","name":"max_notify_queue_pages","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Disk","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"16","status":"added","to":"17"}],"content_hash":"5adb16c471a547f9da54a04aef4be12d11f1d5bae0e46f89f12a079093728043","context":"","default_changed_in":[],"default_history":[{"from":"17","to":"19","value":"1048576"}],"derived_content_hash":"67b99ca2a96ee66d3c1ace291bbdf44a9678e7261e4ac056bd04086c4b275d49","editorial":{"advice":{"olap":"An OLAP label does not justify a larger queue. Long analytical transactions in listening sessions can delay cleanup, so separate listeners from long transactions and measure notification production versus consumption.","oltp":"Monitor pg_notification_queue_usage() and identify listeners that remain in long transactions before increasing capacity. Size the disk-backed queue from the maximum tolerated notification backlog and available database volume, not query scan throughput.","small":"Keep the default unless the application has a verified LISTEN/NOTIFY backlog requirement. More pages permit more disk consumption and postpone failure; they do not fix a stalled listener."},"mechanism":["max_notify_queue_pages caps the number of database pages that the disk-backed LISTEN/NOTIFY queue may allocate. At the usual 8kB BLCKSZ, the PG18 default permits up to 8GB.","Notifications remain queued until all listening sessions have consumed or no longer need them. A listener that stays inside a long transaction can prevent cleanup and let queue usage grow.","This is disk capacity, not notify_buffers memory and not a limit on one payload. When the queue is full, transactions attempting NOTIFY can fail at commit. Its postmaster context fixes the value at server start; changing it requires a restart."],"pitfalls":["Increasing queue capacity instead of fixing a listener that stays inside a long transaction.","Confusing max_notify_queue_pages disk capacity with notify_buffers shared-memory cache.","Forgetting that, with 8kB pages, the default 1048576 pages permits up to about 8GB.","Assuming a larger queue changes an individual NOTIFY payload limit or delivery semantics."],"references":[{"title":"PostgreSQL 19 Beta 4: max_notify_queue_pages","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MAX-NOTIFY-QUEUE-PAGES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["notify_buffers","track_activities","max_connections","shared_buffers"],"summary":"max_notify_queue_pages — Sets the maximum number of allocated pages for NOTIFY / LISTEN queue. Observed in PG17–19 Beta 4; its last measured boot default is 1048576 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"17","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.707752+08:00","intro_commit":{"authored_at":"2023-11-29T01:41:48+02:00","discussion":["https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com","https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com"],"hash":"2cdf131c46e631addfc386f6106e52a1b8cc3a70","subject":"Use larger segment file names for pg_notify","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2cdf131c46e631addfc386f6106e52a1b8cc3a70"},"key":"max_notify_queue_pages","last_version":"20","max_val":"","min_val":"","name":"max_notify_queue_pages","position":272,"present_in":["17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:b4c44e64ee83e323953dc509adaa71d484c7b83d9fd13780223ad6a925da40ef","receipt_sha256":"fa353246b0d913bd8e1ee0c90ca7901dbdb123f00eaa75c3e04c73b273dab6fd","repair":"wiki-repair-20261023"},"short_desc":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue.","short_desc_zh":"","source_rev":"wiki-repair-20261023:2e14d42e410c01a5fad93c9f2595ff1a9cc644da19a1d8e2e168f99bcbf75c3f","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_notify_queue_pages","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_notify_queue_pages","SourceRevision":"wiki-repair-20261023:2e14d42e410c01a5fad93c9f2595ff1a9cc644da19a1d8e2e168f99bcbf75c3f","Facts":{"boot_val":"1048576","category":"Resource Usage / Disk","context":"postmaster","description":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue. The default value is 1048576. For 8 KB pages it allows to consume up to 8 GB of disk space. This parameter can only be set at server start.","description_zh":"指定 NOTIFY / LISTEN 队列可分配页面的最大数量。默认值是 1048576。对于 8 KB 页面，这允许最多消耗 8 GB 的磁盘空间。此参数只能在服务器启动时设置。","description_zh_html":"\u003cp\u003e\n        指定 \u003ca class=\"xref\" href=\"/zh/docs/18/sql-notify.html\" title=\"NOTIFY\"\u003e\u003cspan class=\"refentrytitle\"\u003eNOTIFY\u003c/span\u003e\u003c/a\u003e / \u003ca class=\"xref\" href=\"/zh/docs/18/sql-listen.html\" title=\"LISTEN\"\u003e\u003cspan class=\"refentrytitle\"\u003eLISTEN\u003c/span\u003e\u003c/a\u003e 队列可分配页面的最大数量。默认值是 1048576。对于 8 KB 页面，这允许最多消耗 8 GB 的磁盘空间。此参数只能在服务器启动时设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-MAX-NOTIFY-QUEUE-PAGES","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"64","name":"max_notify_queue_pages","short_desc":"Sets the maximum number of allocated pages for NOTIFY / LISTEN queue.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-resource.html","sha256":"f5fedbf88ec5f973aaf4e525c03e46dda2a2186dabee154e26780da96b2ac85a"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-NOTIFY-QUEUE-PAGES","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_notify_queue_pages","SourceDatabase":"center","Version":"18","Locale":"en","Title":"max_notify_queue_pages","Summary":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue. The default value is 1048576. For 8 KB pages it allows to consume up to 8 GB of disk space. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eSpecifies the maximum amount of allocated pages for NOTIFY / LISTEN queue. The default value is 1048576. For 8 KB pages it allows to consume up to 8 GB of disk space. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:2e14d42e410c01a5fad93c9f2595ff1a9cc644da19a1d8e2e168f99bcbf75c3f","ContentHash":"13fb005b683b4ced1f8a6161e911c515519e4174ad4e6d276c1962bd155f3378","Payload":{"description":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue. The default value is 1048576. For 8 KB pages it allows to consume up to 8 GB of disk space. This parameter can only be set at server start."}},"RequestedLocale":"en","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
