{
  "schema_version": 2,
  "id": "commands/psubscribe",
  "title": "PSUBSCRIBE",
  "url": "https://redis.io/docs/latest/commands/psubscribe/",
  "summary": "Listens for messages published to channels that match one or more patterns.",
  "since": "2.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:25+01:00",
  "page_type": "content",
  "content_hash": "cc0602da15df93121f8bb38769eeb1d4fa357baa115b701b140395788e231e98",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Subscribes the client to the given patterns.\n\n\nOnce the client enters the subscribed state it is not supposed to issue any other commands, except for additional [`SUBSCRIBE`](https://redis.io/docs/latest/commands/subscribe), [`SSUBSCRIBE`](https://redis.io/docs/latest/commands/ssubscribe), `PSUBSCRIBE`, [`UNSUBSCRIBE`](https://redis.io/docs/latest/commands/unsubscribe), [`SUNSUBSCRIBE`](https://redis.io/docs/latest/commands/sunsubscribe), [`PUNSUBSCRIBE`](https://redis.io/docs/latest/commands/punsubscribe), [`PING`](https://redis.io/docs/latest/commands/ping), [`RESET`](https://redis.io/docs/latest/commands/reset) and [`QUIT`](https://redis.io/docs/latest/commands/quit) commands.\nHowever, if RESP3 is used (see [`HELLO`](https://redis.io/docs/latest/commands/hello)), it is possible for a client to issue any commands while in a subscribed state.\n\nFor more information, see [Pub/sub](https://redis.io/docs/latest/develop/pubsub)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>pattern [pattern ...]</code></summary>\n\nOne or more glob-style patterns to subscribe to. Messages published to any channel whose name matches a pattern are delivered to the client.\n\nSupported glob-style patterns:\n\n* `h?llo` subscribes to `hello`, `hallo` and `hxllo`\n* `h*llo` subscribes to `hllo` and `heeeello`\n* `h[ae]llo` subscribes to `hello` and `hallo,` but not `hillo`\n\nUse `\\` to escape special characters if you want to match them verbatim.\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nWhen successful, this command doesn't return anything. Instead, for each pattern, one message with the first element being the string `psubscribe` is pushed as a confirmation that the command succeeded.\n\n**RESP3:**\n\nWhen successful, this command doesn't return anything. Instead, for each pattern, one message with the first element being the string `psubscribe` is pushed as a confirmation that the command succeeded."
    }
  ],
  "examples": []
}
