{
    "mode": "man",
    "parameter": "UNLISTEN",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/UNLISTEN/7/json",
    "generated": "2026-05-30T06:07:21Z",
    "synopsis": "UNLISTEN { channel | * }",
    "sections": {
        "NAME": {
            "content": "UNLISTEN - stop listening for a notification\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "UNLISTEN { channel | * }\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "UNLISTEN is used to remove an existing registration for NOTIFY events.  UNLISTEN cancels any\nexisting registration of the current PostgreSQL session as a listener on the notification\nchannel named channel. The special wildcard * cancels all listener registrations for the\ncurrent session.\n\nNOTIFY(7) contains a more extensive discussion of the use of LISTEN and NOTIFY.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "channel\nName of a notification channel (any identifier).\n\n*\nAll current listen registrations for this session are cleared.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "You can unlisten something you were not listening for; no warning or error will appear.\n\nAt the end of each session, UNLISTEN * is automatically executed.\n\nA transaction that has executed UNLISTEN cannot be prepared for two-phase commit.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To make a registration:\n\nLISTEN virtual;\nNOTIFY virtual;\nAsynchronous notification \"virtual\" received from server process with PID 8448.\n\nOnce UNLISTEN has been executed, further NOTIFY messages will be ignored:\n\nUNLISTEN virtual;\nNOTIFY virtual;\n-- no NOTIFY event is received\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "There is no UNLISTEN command in the SQL standard.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "LISTEN(7), NOTIFY(7)\n\n\n\nPostgreSQL 14.23                                2026                                     UNLISTEN(7)",
            "subsections": []
        }
    },
    "summary": "UNLISTEN - stop listening for a notification",
    "flags": [],
    "examples": [
        "To make a registration:",
        "LISTEN virtual;",
        "NOTIFY virtual;",
        "Asynchronous notification \"virtual\" received from server process with PID 8448.",
        "Once UNLISTEN has been executed, further NOTIFY messages will be ignored:",
        "UNLISTEN virtual;",
        "NOTIFY virtual;",
        "-- no NOTIFY event is received"
    ],
    "see_also": [
        {
            "name": "LISTEN",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/LISTEN/7/json"
        },
        {
            "name": "NOTIFY",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/NOTIFY/7/json"
        }
    ]
}