{"kind": "tool", "major": "18", "item": {"slug": "pg-createsubscriber", "name": "pg_createsubscriber", "name_zh": "", "category": "\u670d\u52a1\u7aef\u7a0b\u5e8f", "summary": "pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c", "aliases": ["pg_createsubscriber"], "content_hash": "b2fc4cc944f792024b8f26775fe0fed76c08071f7bd2870d29a40e3696bcc6f1", "versions": {"17": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_createsubscriber"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "17.11"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "15"}], "tables": [{"key": "options", "rows": [{"summary": "\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a -d \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-d dbname --database= dbname"}}, {"summary": "\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-D directory --pgdata= directory"}}, {"summary": "\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-n --dry-run"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-p port --subscriber-port= port"}}, {"summary": "\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1 \u7b2c 32.1.1 \u8282 \u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-P connstr --publisher-server= connstr"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-s dir --socketdir= dir"}}, {"summary": "\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-t seconds --recovery-timeout= seconds"}}, {"summary": "\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-U username --subscriber-username= username"}}, {"summary": "\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f pg_createsubscriber \u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-v --verbose"}}, {"summary": "\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002 pg_createsubscriber \u5728\u5185\u90e8\u4f7f\u7528 pg_ctl \u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684 postgresql.conf \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "--config-file= filename"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --publication \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "--publication= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --replication-slot \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "--replication-slot= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --subscription \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "--subscription= name"}}, {"summary": "\u6253\u5370 pg_createsubscriber \u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-V --version"}}, {"summary": "\u663e\u793a pg_createsubscriber \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pgcreatesubscriber.html", "text": "-? --help"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}], "options": [{"names": ["-d dbname", "--database= dbname"], "summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches.", "signature": "-d dbname --database= dbname", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches."}, {"names": ["-D directory", "--pgdata= directory"], "summary": "The target directory that contains a cluster directory from a physical replica.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "summary": "Do everything except actually modifying the target directory.", "signature": "-n --dry-run", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "signature": "-p port --subscriber-port= port", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "summary": "The connection string to the publisher. For details see Section 32.1.1 .", "signature": "-P connstr --publisher-server= connstr", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "signature": "-s dir --socketdir= dir", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "signature": "-t seconds --recovery-timeout= seconds", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-U username", "--subscriber-username= username"], "summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "signature": "-U username --subscriber-username= username", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--config-file= filename"], "summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "signature": "--config-file= filename", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name.", "signature": "--publication= name", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name."}, {"names": ["--replication-slot= name"], "summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name.", "signature": "--replication-slot= name", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name."}, {"names": ["--subscription= name"], "summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name.", "signature": "--subscription= name", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name."}, {"names": ["-V", "--version"], "summary": "Print the pg_createsubscriber version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_createsubscriber command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-pgcreatesubscriber.html", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/17/postgresql-17-A4.pdf", "bytes": 15521293, "pages": 3099, "sha256": "1991354df0dc89e70ec39328c28988ef8b19c6a93671dab3893650b63e9f4e36", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/17/postgresql-17-US.pdf", "bytes": 15398150, "pages": 3270, "sha256": "07696c8f38abf31babf22d2db337093936e7c472d2af36d050b000c49bbcf52c", "built_at": "2026-09-26"}}, "tree": "17", "index": "index.html", "major": "17", "pages": 1143, "release": "17.11", "source_url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "revision": "58419c9b0dd42cb34c8d53695bb025a7e582edf55ccd4c5bcb1c2c7c71a37487", "evidence_kind": "English manual and source declarations", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "sources": [{"url": "https://pg.center/docs/17/app-pgcreatesubscriber.html", "file": "app-pgcreatesubscriber.html", "label": "17.11 English manual \u00b7 app-pgcreatesubscriber.html", "anchor": "", "sha256": "acc0ccb21b3ea99df91f6bcf9db0e12b9e2b582391e36ac1f3f06ee2c7411337", "language": "en", "original_url": "/docs/17/app-pgcreatesubscriber.html"}, {"url": "https://pg.center/docs/17/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "01f07993ff020684f4c290d17cdafa26fb17ea5c1d476bc3a5efc68bf8ddd9b9", "language": "en", "original_url": "/docs/17/reference-server.html"}], "sections": [], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "signature": "pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr", "description": ["pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCREATESUBSCRIBER\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_createsubscriber</span></span></h2>\n<p lang=\"zh\">pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.1\"><code class=\"command\">pg_createsubscriber</code> [<em class=\"replaceable\"><code>option</code></em>...] { <code class=\"option\">-d</code> | <code class=\"option\">--database</code> }<em class=\"replaceable\"><code>dbname</code></em> { <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> }<em class=\"replaceable\"><code>datadir</code></em> { <code class=\"option\">-P</code> | <code class=\"option\">--publisher-server</code> }<em class=\"replaceable\"><code>connstr</code></em></p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4ece\u7269\u7406\u5907\u5e93\u521b\u5efa\u65b0\u7684\u903b\u8f91\u526f\u672c\u3002\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u90fd\u4f1a\u5305\u542b\u5728<a class=\"link\" href=\"/docs/17/logical-replication.html\" title=\"\u7b2c\u00a029\u00a0\u7ae0\u00a0\u903b\u8f91\u590d\u5236\">\u903b\u8f91\u590d\u5236</a>\u914d\u7f6e\u4e2d\u3002\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u4f1a\u521b\u5efa\u4e00\u5bf9\u53d1\u5e03\u548c\u8ba2\u9605\u5bf9\u8c61\u3002\u8be5\u5de5\u5177\u5fc5\u987b\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002</p>\n<p lang=\"zh\">\u6210\u529f\u8fd0\u884c\u540e\uff0c\u76ee\u6807\u670d\u52a1\u5668\u7684\u72b6\u6001\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u65b0\u7684\u903b\u8f91\u590d\u5236\u914d\u7f6e\u3002\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e0e<span class=\"application\">pg_createsubscriber</span>\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u6570\u636e\u540c\u6b65\u7684\u5b8c\u6210\u65b9\u5f0f\u3002<span class=\"application\">pg_createsubscriber</span> \u4e0d\u4f1a\u590d\u5236\u521d\u59cb\u8868\u6570\u636e\u3002\u5b83\u53ea\u6267\u884c\u540c\u6b65\u9636\u6bb5\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u8868\u90fd\u8fbe\u5230\u540c\u6b65\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4e3b\u8981\u9762\u5411\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e2d\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u590d\u5236\u521d\u59cb\u6570\u636e\u4e0a\u3002\u6b64\u5916\uff0c\u5728\u6570\u636e\u540c\u6b65\u4e0a\u82b1\u8d39\u8f83\u957f\u65f6\u95f4\u7684\u4e00\u4e2a\u526f\u4f5c\u7528\u901a\u5e38\u662f\uff0c\u4f1a\u6709\u5927\u91cf\u5728\u521d\u59cb\u6570\u636e\u590d\u5236\u671f\u95f4\u4ea7\u751f\u7684\u66f4\u6539\u9700\u8981\u5e94\u7528\uff0c\u8fd9\u4f1a\u8fdb\u4e00\u6b65\u5ef6\u540e\u903b\u8f91\u526f\u672c\u53ef\u7528\u7684\u65f6\u95f4\u3002\u5bf9\u4e8e\u8f83\u5c0f\u7684\u6570\u636e\u5e93\uff0c\u5efa\u8bae\u5efa\u7acb\u5e26\u521d\u59cb\u6570\u636e\u540c\u6b65\u7684\u903b\u8f91\u590d\u5236\u3002\u8be6\u89c1<code class=\"command\">CREATE SUBSCRIPTION</code>\u7684 <a class=\"link\" href=\"/docs/17/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-COPY-DATA\"><code class=\"literal\">copy_data</code></a>\u9009\u9879\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.6\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">-d</code>\u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code><br/></span><span class=\"term\"><code class=\"option\">--dry-run</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>connstr</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--publisher-server=<em class=\"replaceable\"><code>connstr</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1<a class=\"xref\" href=\"/docs/17/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u7b2c\u00a032.1.1\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>dir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--socketdir=<em class=\"replaceable\"><code>dir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--recovery-timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f <span class=\"application\">pg_createsubscriber</span>\u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--config-file=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<span class=\"application\">pg_createsubscriber</span>\u5728\u5185\u90e8\u4f7f\u7528 <span class=\"application\">pg_ctl</span>\u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684<code class=\"filename\">postgresql.conf</code>\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--publication=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--publication</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--replication-slot=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--replication-slot</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--subscription=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--subscription</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_createsubscriber</span>\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a<span class=\"application\">pg_createsubscriber</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.2\">\n<h3 lang=\"zh\">\u524d\u7f6e\u6761\u4ef6</h3>\n<p lang=\"zh\">\u8981\u8ba9<span class=\"application\">pg_createsubscriber</span>\u5c06\u76ee\u6807\u670d\u52a1\u5668\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u9700\u8981\u6ee1\u8db3\u4e00\u4e9b\u524d\u63d0\u6761\u4ef6\u3002\u5982\u679c\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u5c31\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u6e90\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7684\u4e3b\u7248\u672c\u5fc5\u987b\u4e0e <span class=\"application\">pg_createsubscriber</span>\u76f8\u540c\u3002\u7ed9\u5b9a\u7684\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5fc5\u987b\u4e0e\u6e90\u6570\u636e\u76ee\u5f55\u5177\u6709\u76f8\u540c\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u6307\u5b9a\u7684\u6570\u636e\u5e93\u7528\u6237\u5fc5\u987b\u5177\u5907\u521b\u5efa<a class=\"link\" href=\"/docs/17/sql-createsubscription.html\" title=\"CREATE SUBSCRIPTION\">\u8ba2\u9605</a>\u4ee5\u53ca\u4f7f\u7528<a class=\"link\" href=\"/docs/17/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u7684\u6743\u9650\u3002</p>\n<p lang=\"zh\">\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u4f5c\u4e3a\u7269\u7406\u5907\u5e93\u4f7f\u7528\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u548c<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS\">max_logical_replication_workers</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u6765\u81ea\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u6e90\u670d\u52a1\u5668\u4e0d\u80fd\u5904\u4e8e\u6062\u590d\u4e2d\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-wal.html#GUC-WAL-LEVEL\">wal_level</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">logical</code>\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u52a0\u73b0\u6709\u590d\u5236\u69fd\u6570\u91cf\u7684\u503c\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\">max_wal_senders</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u4e0e\u73b0\u6709 WAL \u53d1\u9001\u8fdb\u7a0b\u6570\u91cf\u4e4b\u548c\u7684\u503c\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.3\">\n<h3 lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5728\u76ee\u6807\u670d\u52a1\u5668\u88ab\u63d0\u5347\u540e\u5931\u8d25\uff0c\u6570\u636e\u76ee\u5f55\u5f88\u53ef\u80fd\u5df2\u5904\u4e8e\u4e0d\u53ef\u6062\u590d\u72b6\u6001\u3002\u6b64\u65f6\u5efa\u8bae\u91cd\u65b0\u521b\u5efa\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c<span class=\"application\">pg_createsubscriber</span>\u901a\u5e38\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u8fde\u63a5\u8bbe\u7f6e\u6765\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5e94\u8be5\u4f1a\u5931\u8d25\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e\u903b\u8f91\u590d\u5236\u4e0d\u590d\u5236 DDL \u547d\u4ee4\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\u5e94\u907f\u514d\u6267\u884c\u4f1a\u66f4\u6539\u6570\u636e\u5e93\u6a21\u5f0f\u7684 DDL \u547d\u4ee4\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u76f8\u5173 DDL \u53ef\u80fd\u4e0d\u4f1a\u88ab\u590d\u5236\uff0c\u4ece\u800c\u5f15\u53d1\u9519\u8bef\u3002</p>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5904\u7406\u8fc7\u7a0b\u4e2d\u5931\u8d25\uff0c\u4f1a\u5220\u9664\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u5bf9\u8c61\uff08\u53d1\u5e03\u3001\u590d\u5236\u69fd\uff09\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5220\u9664\u53ef\u80fd\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8b66\u544a\u6d88\u606f\u4f1a\u63d0\u793a\u9057\u7559\u7684\u5bf9\u8c61\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u5b83\u4f1a\u88ab\u505c\u6b62\u3002</p>\n<p lang=\"zh\">\u82e5\u590d\u5236\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u5b8c\u6210\u540e\u4f1a\u4ece\u6e90\u670d\u52a1\u5668\u79fb\u9664\u8be5\u590d\u5236\u69fd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u662f\u540c\u6b65\u526f\u672c\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\uff0c\u4e3b\u5e93\u4e0a\u7684\u4e8b\u52a1\u63d0\u4ea4\u53ef\u80fd\u4f1a\u5728\u7b49\u5f85\u590d\u5236\u65f6\u963b\u585e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u5728\u7981\u7528\u4e24\u9636\u6bb5\u63d0\u4ea4\u7684\u60c5\u51b5\u4e0b\u5efa\u7acb\u903b\u8f91\u590d\u5236\u3002\u8fd9\u610f\u5473\u7740\u4efb\u4f55\u9884\u5907\u4e8b\u52a1\u90fd\u4f1a\u5728<code class=\"command\">COMMIT PREPARED</code>\u65f6\u88ab\u590d\u5236\uff0c\u800c\u4e0d\u4f1a\u4e8b\u5148\u8fdb\u884c\u9884\u5907\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u8ba2\u9605\uff0c\u5e76\u542f\u7528<a class=\"link\" href=\"/docs/17/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u4f7f\u7528<span class=\"application\">pg_resetwal</span> \u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u76ee\u6807\u670d\u52a1\u5668\u53ef\u80fd\u4f7f\u7528\u6e90\u670d\u52a1\u5668\u7684 WAL \u6587\u4ef6\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u6709\u5907\u5e93\uff0c\u590d\u5236\u5c06\u4f1a\u4e2d\u65ad\uff0c\u5e94\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5907\u5e93\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.4\">\n<h3 lang=\"zh\">\u5de5\u4f5c\u539f\u7406</h3>\n<p lang=\"zh\">\u57fa\u672c\u601d\u8def\u662f\u4ece\u6e90\u670d\u52a1\u5668\u83b7\u5f97\u590d\u5236\u8d77\u70b9\uff0c\u5e76\u4ece\u8be5\u4f4d\u7f6e\u5f00\u59cb\u5efa\u7acb\u903b\u8f91\u590d\u5236\uff1a</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" lang=\"zh\">\n<p>\u4f7f\u7528\u6307\u5b9a\u547d\u4ee4\u884c\u9009\u9879\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u5728\u8fd0\u884c\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u68c0\u67e5\u76ee\u6807\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8f6c\u6362\uff0c\u540c\u65f6\u4e5f\u4f1a\u5bf9\u6e90\u670d\u52a1\u5668\u8fdb\u884c\u4e00\u4e9b\u68c0\u67e5\u3002\u82e5\u4efb\u4e00\u524d\u7f6e\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u521b\u5efa\u4e00\u4e2a\u53d1\u5e03\u548c\u4e00\u4e2a\u590d\u5236\u69fd\u3002\u6bcf\u4e2a\u53d1\u5e03\u90fd\u4ee5<a class=\"link\" href=\"/docs/17/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"><code class=\"literal\">FOR ALL TABLES</code></a>\u521b\u5efa\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--publication</code>\uff0c\u53d1\u5e03\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--replication-slot</code>\uff0c\u590d\u5236\u69fd\u7684\u540d\u79f0\u6a21\u5f0f\u5982\u4e0b\uff1a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8fd9\u4e9b\u590d\u5236\u69fd\u5c06\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u88ab\u8ba2\u9605\u4f7f\u7528\u3002\u6700\u540e\u4e00\u4e2a\u590d\u5236\u69fd\u7684 LSN \u4f1a\u5728<a class=\"xref\" href=\"/docs/17/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\u53c2\u6570\u4e2d\u7528\u4f5c\u505c\u6b62\u70b9\uff0c\u4e5f\u4f1a\u88ab\u8ba2\u9605\u7528\u4f5c\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6062\u590d\u53c2\u6570\u5199\u5165\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5e76\u91cd\u542f\u76ee\u6807\u670d\u52a1\u5668\u3002\u5b83\u6307\u5b9a\u4e86\u6062\u590d\u5c06\u63a8\u8fdb\u5230\u7684\u9884\u5199\u5f0f\u65e5\u5fd7\u4f4d\u7f6e\u7684 LSN\uff08<a class=\"xref\" href=\"/docs/17/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\uff09\u3002\u5b83\u8fd8\u5c06<code class=\"literal\">promote</code>\u6307\u5b9a\u4e3a\u670d\u52a1\u5668\u5728\u8fbe\u5230\u6062\u590d\u76ee\u6807\u540e\u5e94\u6267\u884c\u7684\u52a8\u4f5c\u3002\u8fd8\u4f1a\u6dfb\u52a0\u5176\u4ed6<a class=\"link\" href=\"/docs/17/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET\" title=\"19.5.6.\u00a0\u6062\u590d\u76ee\u6807\">\u6062\u590d\u53c2\u6570</a>\uff0c\u4ee5\u907f\u514d\u6062\u590d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u610f\u5916\u884c\u4e3a\uff0c\u4f8b\u5982\u4e00\u8fbe\u5230\u4e00\u81f4\u72b6\u6001\u5c31\u7ed3\u675f\u6062\u590d\uff08WAL \u5e94\u7ee7\u7eed\u5e94\u7528\u5230\u590d\u5236\u8d77\u59cb\u4f4d\u7f6e\uff09\uff0c\u6216\u8005\u56e0\u6307\u5b9a\u591a\u4e2a\u6062\u590d\u76ee\u6807\u800c\u5931\u8d25\u3002\u5f53\u670d\u52a1\u5668\u9000\u51fa\u5907\u5e93\u6a21\u5f0f\u5e76\u63a5\u53d7\u8bfb\u5199\u4e8b\u52a1\u65f6\uff0c\u8be5\u6b65\u9aa4\u7ed3\u675f\u3002\u5982\u679c\u8bbe\u7f6e\u4e86<code class=\"option\">--recovery-timeout</code>\u9009\u9879\uff0c\u800c\u6062\u590d\u5728\u7ed9\u5b9a\u79d2\u6570\u5185\u6ca1\u6709\u7ed3\u675f\uff0c<span class=\"application\">pg_createsubscriber</span>\u5c31\u4f1a\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u521b\u5efa\u8ba2\u9605\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--subscription</code>\uff0c\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8be5\u8ba2\u9605\u4e0d\u4f1a\u590d\u5236\u6e90\u670d\u52a1\u5668\u4e0a\u7684\u73b0\u6709\u6570\u636e\uff0c\u4e5f\u4e0d\u4f1a\u521b\u5efa\u590d\u5236\u69fd\uff0c\u800c\u662f\u4f7f\u7528\u524d\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u590d\u5236\u69fd\u3002\u8ba2\u9605\u4f1a\u88ab\u521b\u5efa\uff0c\u4f46\u5c1a\u4e0d\u542f\u7528\uff0c\u56e0\u4e3a\u5fc5\u987b\u5728\u542f\u52a8\u590d\u5236\u4e4b\u524d\u5148\u5c06\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u5230\u590d\u5236\u8d77\u70b9\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5220\u9664\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u88ab\u590d\u5236\u8fc7\u6765\u7684\u53d1\u5e03\uff08\u8fd9\u4e9b\u53d1\u5e03\u662f\u5728\u590d\u5236\u8d77\u70b9\u524d\u521b\u5efa\u7684\uff09\uff0c\u5b83\u4eec\u5728\u8ba2\u9605\u8005\u4e0a\u6ca1\u6709\u7528\u9014\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6bcf\u4e2a\u8ba2\u9605\u7684\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u590d\u5236\u8d77\u70b9\u3002\u5f53\u76ee\u6807\u670d\u52a1\u5668\u5f00\u59cb\u6062\u590d\u8fc7\u7a0b\u65f6\uff0c\u5b83\u4f1a\u8ffd\u8d76\u5230\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6b63\u662f\u6bcf\u4e2a\u8ba2\u9605\u8981\u7528\u4f5c\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u7684 LSN\u3002\u7531\u4e8e\u8ba2\u9605\u5df2\u7ecf\u521b\u5efa\uff0c\u56e0\u6b64\u53ef\u4ee5\u53d6\u5f97\u590d\u5236\u6e90\u540d\u79f0\u3002\u4f7f\u7528\u590d\u5236\u6e90\u540d\u79f0\u548c\u590d\u5236\u8d77\u70b9\u8c03\u7528 <a class=\"link\" href=\"/docs/17/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u4ee5\u8bbe\u7f6e\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u7684\u8ba2\u9605\u3002\u8ba2\u9605\u5c06\u4ece\u590d\u5236\u8d77\u70b9\u5f00\u59cb\u5e94\u7528\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/17/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u8be5\u590d\u5236\u69fd\u4e4b\u540e\u4e0d\u518d\u6709\u7528\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u5305\u542b<a class=\"link\" href=\"/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS-SYNCHRONIZATION\" title=\"47.2.3.\u00a0\u590d\u5236\u69fd\u540c\u6b65\">\u6545\u969c\u5207\u6362\u590d\u5236\u69fd</a>\uff0c\u5b83\u4eec\u540e\u7eed\u65e0\u6cd5\u7ee7\u7eed\u540c\u6b65\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u66f4\u65b0\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4f1a\u8fd0\u884c<a class=\"xref\" href=\"/docs/17/app-pgresetwal.html\" title=\"pg_resetwal\"><span class=\"refentrytitle\"><span class=\"application\">pg_resetwal</span></span></a>\u6765\u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u7531\u4e8e<code class=\"command\">pg_resetwal</code>\u7684\u8981\u6c42\uff0c\u76ee\u6807\u670d\u52a1\u5668\u4f1a\u88ab\u505c\u6b62\u3002</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u4ece foo \u4e0a\u7684\u7269\u7406\u526f\u672c\u4e3a hr \u548c finance \u6570\u636e\u5e93\u521b\u5efa\u903b\u8f91\u526f\u672c\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_createsubscriber -D /usr/local/pgsql/data -P \"host=foo\" -d hr -d finance</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.9\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/17/app-pgbasebackup.html\" title=\"pg_basebackup\"><span class=\"refentrytitle\"><span class=\"application\">pg_basebackup</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgcreatesubscriber.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/app-pgcreatesubscriber.html", "method": "same-major semantic node", "sha256": "d9f33a68a30cc3591adcf86dfeabe58bd66f8055c88f22edc8a327b685287185", "language": "zh", "matched_nodes": ["#APP-PGCREATESUBSCRIBER/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[3]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[4]/p[1]", "#APP-PGCREATESUBSCRIBER/div[4]/p[2]", "#APP-PGCREATESUBSCRIBER/div[4]/p[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[11]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[19]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[21]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[9]", "#APP-PGCREATESUBSCRIBER/div[5]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[10]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[7]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[8]/h2[0]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/versions/17/facts/0/label": "Documented executable", "/versions/17/facts/1/label": "Executable version", "/versions/17/facts/2/label": "Reference inventory", "/versions/17/facts/2/value": "Server applications", "/versions/17/facts/3/label": "Option definition groups", "/versions/17/tables/0/title": "Documented options", "/versions/17/tables/0/rows/0/summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches.", "/versions/17/tables/0/rows/1/summary": "The target directory that contains a cluster directory from a physical replica.", "/versions/17/tables/0/rows/2/summary": "Do everything except actually modifying the target directory.", "/versions/17/tables/0/rows/3/summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "/versions/17/tables/0/rows/4/summary": "The connection string to the publisher. For details see Section 32.1.1 .", "/versions/17/tables/0/rows/5/summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "/versions/17/tables/0/rows/6/summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "/versions/17/tables/0/rows/7/summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "/versions/17/tables/0/rows/8/summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/17/tables/0/rows/9/summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "/versions/17/tables/0/columns/0/label": "Option and arguments", "/versions/17/tables/0/columns/1/label": "Description", "/versions/17/tables/0/rows/10/summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name.", "/versions/17/tables/0/rows/11/summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name.", "/versions/17/tables/0/rows/12/summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name.", "/versions/17/tables/0/rows/13/summary": "Print the pg_createsubscriber version and exit.", "/versions/17/tables/0/rows/14/summary": "Show help about pg_createsubscriber command line arguments, and exit."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "67bbe37e0b3fb35f4029a847713b17964e036cdee5abb66ff2226fbbb733a48d"}, "comparison_data": {"options": [{"names": ["-d dbname", "--database= dbname"], "signature": "-d dbname --database= dbname", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches."}, {"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "signature": "-n --dry-run", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "signature": "-p port --subscriber-port= port", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "signature": "-P connstr --publisher-server= connstr", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "signature": "-s dir --socketdir= dir", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "signature": "-t seconds --recovery-timeout= seconds", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-U username", "--subscriber-username= username"], "signature": "-U username --subscriber-username= username", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--config-file= filename"], "signature": "--config-file= filename", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "signature": "--publication= name", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name."}, {"names": ["--replication-slot= name"], "signature": "--replication-slot= name", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name."}, {"names": ["--subscription= name"], "signature": "--subscription= name", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "environment": []}, "comparison_hash": "104b1091aa60e86021ca6825e5d2414d196b482450979f525b6f54db62c8b4dd", "manual_language": "zh"}, "18": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_createsubscriber"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528 --publisher-server \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 postgres \u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 template1 \u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --database \u3001 --publication \u3001 --replication-slot \u6216 --subscription \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-a --all"}}, {"summary": "\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a -d \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e -a \u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b -d \u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece -P \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728 -d \u9009\u9879\u6216 -P \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a -a \u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-d dbname --database= dbname"}}, {"summary": "\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-D directory --pgdata= directory"}}, {"summary": "\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-n --dry-run"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-p port --subscriber-port= port"}}, {"summary": "\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1 \u7b2c 32.1.1 \u8282 \u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-P connstr --publisher-server= connstr"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-s dir --socketdir= dir"}}, {"summary": "\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-t seconds --recovery-timeout= seconds"}}, {"summary": "\u4e3a\u8ba2\u9605\u542f\u7528 two_phase \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a false \u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-T --enable-two-phase"}}, {"summary": "\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-U username --subscriber-username= username"}}, {"summary": "\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f pg_createsubscriber \u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-v --verbose"}}, {"summary": "\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--clean= objtype"}}, {"summary": "\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002 pg_createsubscriber \u5728\u5185\u90e8\u4f7f\u7528 pg_ctl \u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684 postgresql.conf \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--config-file= filename"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --publication \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--publication= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --replication-slot \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--replication-slot= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --subscription \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--subscription= name"}}, {"summary": "\u6253\u5370 pg_createsubscriber \u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-V --version"}}, {"summary": "\u663e\u793a pg_createsubscriber \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-? --help"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}], "options": [{"names": ["-a", "--all"], "summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "signature": "-a --all", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "signature": "-d dbname --database= dbname", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D directory", "--pgdata= directory"], "summary": "The target directory that contains a cluster directory from a physical replica.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "summary": "Do everything except actually modifying the target directory.", "signature": "-n --dry-run", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "signature": "-p port --subscriber-port= port", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "summary": "The connection string to the publisher. For details see Section 32.1.1 .", "signature": "-P connstr --publisher-server= connstr", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "signature": "-s dir --socketdir= dir", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "signature": "-t seconds --recovery-timeout= seconds", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "signature": "-T --enable-two-phase", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "signature": "-U username --subscriber-username= username", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "summary": "Drop all objects of the specified type from specified databases on the target server.", "signature": "--clean= objtype", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "signature": "--config-file= filename", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "signature": "--publication= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all ."}, {"names": ["--replication-slot= name"], "summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "signature": "--replication-slot= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "signature": "--subscription= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "summary": "Print the pg_createsubscriber version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_createsubscriber command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/app-pgcreatesubscriber.html", "file": "app-pgcreatesubscriber.html", "label": "18.6 English manual \u00b7 app-pgcreatesubscriber.html", "anchor": "", "sha256": "fb0e5cd7f37044410e06deb436d7b70a1bceffbd849ce10f468351d9cf11d385", "language": "en", "original_url": "/docs/18/app-pgcreatesubscriber.html"}, {"url": "https://pg.center/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3", "language": "en", "original_url": "/docs/18/reference-server.html"}], "sections": [], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "signature": "pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr", "description": ["pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCREATESUBSCRIBER\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_createsubscriber</span></span></h2>\n<p lang=\"zh\">pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.1\"><code class=\"command\">pg_createsubscriber</code> [<em class=\"replaceable\"><code>option</code></em>...] { <code class=\"option\">-d</code> | <code class=\"option\">--database</code> }<em class=\"replaceable\"><code>dbname</code></em> { <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> }<em class=\"replaceable\"><code>datadir</code></em> { <code class=\"option\">-P</code> | <code class=\"option\">--publisher-server</code> }<em class=\"replaceable\"><code>connstr</code></em></p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4ece\u7269\u7406\u5907\u5e93\u521b\u5efa\u65b0\u7684\u903b\u8f91\u526f\u672c\u3002\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u90fd\u4f1a\u5305\u542b\u5728<a class=\"link\" href=\"/docs/18/logical-replication.html\" title=\"\u7b2c\u00a029\u00a0\u7ae0\u00a0\u903b\u8f91\u590d\u5236\">\u903b\u8f91\u590d\u5236</a>\u914d\u7f6e\u4e2d\u3002\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u4f1a\u521b\u5efa\u4e00\u5bf9\u53d1\u5e03\u548c\u8ba2\u9605\u5bf9\u8c61\u3002\u8be5\u5de5\u5177\u5fc5\u987b\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002</p>\n<p lang=\"zh\">\u6210\u529f\u8fd0\u884c\u540e\uff0c\u76ee\u6807\u670d\u52a1\u5668\u7684\u72b6\u6001\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u65b0\u7684\u903b\u8f91\u590d\u5236\u914d\u7f6e\u3002\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e0e<span class=\"application\">pg_createsubscriber</span>\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u6570\u636e\u540c\u6b65\u7684\u5b8c\u6210\u65b9\u5f0f\u3002<span class=\"application\">pg_createsubscriber</span> \u4e0d\u4f1a\u590d\u5236\u521d\u59cb\u8868\u6570\u636e\u3002\u5b83\u53ea\u6267\u884c\u540c\u6b65\u9636\u6bb5\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u8868\u90fd\u8fbe\u5230\u540c\u6b65\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4e3b\u8981\u9762\u5411\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e2d\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u590d\u5236\u521d\u59cb\u6570\u636e\u4e0a\u3002\u6b64\u5916\uff0c\u5728\u6570\u636e\u540c\u6b65\u4e0a\u82b1\u8d39\u8f83\u957f\u65f6\u95f4\u7684\u4e00\u4e2a\u526f\u4f5c\u7528\u901a\u5e38\u662f\uff0c\u4f1a\u6709\u5927\u91cf\u5728\u521d\u59cb\u6570\u636e\u590d\u5236\u671f\u95f4\u4ea7\u751f\u7684\u66f4\u6539\u9700\u8981\u5e94\u7528\uff0c\u8fd9\u4f1a\u8fdb\u4e00\u6b65\u5ef6\u540e\u903b\u8f91\u526f\u672c\u53ef\u7528\u7684\u65f6\u95f4\u3002\u5bf9\u4e8e\u8f83\u5c0f\u7684\u6570\u636e\u5e93\uff0c\u5efa\u8bae\u5efa\u7acb\u5e26\u521d\u59cb\u6570\u636e\u540c\u6b65\u7684\u903b\u8f91\u590d\u5236\u3002\u8be6\u89c1<code class=\"command\">CREATE SUBSCRIPTION</code>\u7684 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-COPY-DATA\"><code class=\"literal\">copy_data</code></a>\u9009\u9879\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.6\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528<code class=\"option\">--publisher-server</code> \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">postgres</code>\u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">template1</code>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">--database</code>\u3001<code class=\"option\">--publication</code>\u3001<code class=\"option\">--replication-slot</code>\u6216<code class=\"option\">--subscription</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">-d</code> \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-a</code>\u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b<code class=\"option\">-d</code>\u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728<code class=\"option\">-d</code>\u9009\u9879\u6216<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a<code class=\"option\">-a</code>\u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code><br/></span><span class=\"term\"><code class=\"option\">--dry-run</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>connstr</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--publisher-server=<em class=\"replaceable\"><code>connstr</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1<a class=\"xref\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u7b2c\u00a032.1.1\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>dir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--socketdir=<em class=\"replaceable\"><code>dir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--recovery-timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code><br/></span><span class=\"term\"><code class=\"option\">--enable-two-phase</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u8ba2\u9605\u542f\u7528 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">false</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f <span class=\"application\">pg_createsubscriber</span>\u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--clean=<em class=\"replaceable\"><code>objtype</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<ul class=\"itemizedlist\" style=\"list-style-type: disc;\">\n<li class=\"listitem\">\n<p><code class=\"literal\">publications</code>\uff1a\u4e3a\u8be5\u8ba2\u9605\u8005\u5efa\u7acb\u7684<code class=\"literal\">FOR ALL TABLES</code>\u53d1\u5e03\u603b\u662f\u4f1a\u88ab\u5220\u9664\uff1b\u6307\u5b9a\u6b64\u5bf9\u8c61\u7c7b\u578b\u8fd8\u4f1a\u5220\u9664\u4ece\u6e90\u670d\u52a1\u5668\u590d\u5236\u8fc7\u6765\u7684\u5176\u4ed6\u6240\u6709\u53d1\u5e03\u3002</p>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u88ab\u9009\u4e2d\u8981\u5220\u9664\u7684\u5bf9\u8c61\u90fd\u4f1a\u9010\u4e2a\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\uff0c\u5305\u62ec\u5728<code class=\"option\">--dry-run</code> \u671f\u95f4\u4e5f\u662f\u5982\u6b64\u3002\u6ca1\u6709\u673a\u4f1a\u5e72\u9884\u6216\u505c\u6b62\u8fd9\u4e9b\u5bf9\u8c61\u7684\u5220\u9664\uff0c\u56e0\u6b64\u53ef\u4ee5\u8003\u8651\u4f7f\u7528 <span class=\"application\">pg_dump</span>\u5148\u5bf9\u5b83\u4eec\u8fdb\u884c\u5907\u4efd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--config-file=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<span class=\"application\">pg_createsubscriber</span>\u5728\u5185\u90e8\u4f7f\u7528 <span class=\"application\">pg_ctl</span>\u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684<code class=\"filename\">postgresql.conf</code>\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--publication=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--publication</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--replication-slot=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--replication-slot</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--subscription=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--subscription</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_createsubscriber</span>\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a<span class=\"application\">pg_createsubscriber</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.2\">\n<h3 lang=\"zh\">\u524d\u7f6e\u6761\u4ef6</h3>\n<p lang=\"zh\">\u8981\u8ba9<span class=\"application\">pg_createsubscriber</span>\u5c06\u76ee\u6807\u670d\u52a1\u5668\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u9700\u8981\u6ee1\u8db3\u4e00\u4e9b\u524d\u63d0\u6761\u4ef6\u3002\u5982\u679c\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u5c31\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u6e90\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7684\u4e3b\u7248\u672c\u5fc5\u987b\u4e0e <span class=\"application\">pg_createsubscriber</span>\u76f8\u540c\u3002\u7ed9\u5b9a\u7684\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5fc5\u987b\u4e0e\u6e90\u6570\u636e\u76ee\u5f55\u5177\u6709\u76f8\u540c\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u6307\u5b9a\u7684\u6570\u636e\u5e93\u7528\u6237\u5fc5\u987b\u5177\u5907\u521b\u5efa<a class=\"link\" href=\"/docs/18/sql-createsubscription.html\" title=\"CREATE SUBSCRIPTION\">\u8ba2\u9605</a>\u4ee5\u53ca\u4f7f\u7528<a class=\"link\" href=\"/docs/18/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u7684\u6743\u9650\u3002</p>\n<p lang=\"zh\">\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u4f5c\u4e3a\u7269\u7406\u5907\u5e93\u4f7f\u7528\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-ACTIVE-REPLICATION-ORIGINS\">max_active_replication_origins</a>\u548c<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS\">max_logical_replication_workers</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u5982\u679c\u8ba1\u5212\u4f7f\u7528<code class=\"option\">--enable-two-phase</code> \u5f00\u5173\uff0c\u8fd8\u9700\u8981\u9002\u5f53\u5730\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS\">max_prepared_transactions</a>\u3002</p>\n<p lang=\"zh\">\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u6765\u81ea\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u6e90\u670d\u52a1\u5668\u4e0d\u80fd\u5904\u4e8e\u6062\u590d\u4e2d\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-WAL-LEVEL\">wal_level</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">logical</code>\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u52a0\u73b0\u6709\u590d\u5236\u69fd\u6570\u91cf\u7684\u503c\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\">max_wal_senders</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u4e0e\u73b0\u6709 WAL \u53d1\u9001\u8fdb\u7a0b\u6570\u91cf\u4e4b\u548c\u7684\u503c\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.3\">\n<h3 lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5728\u76ee\u6807\u670d\u52a1\u5668\u88ab\u63d0\u5347\u540e\u5931\u8d25\uff0c\u6570\u636e\u76ee\u5f55\u5f88\u53ef\u80fd\u5df2\u5904\u4e8e\u4e0d\u53ef\u6062\u590d\u72b6\u6001\u3002\u6b64\u65f6\u5efa\u8bae\u91cd\u65b0\u521b\u5efa\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c<span class=\"application\">pg_createsubscriber</span>\u901a\u5e38\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u8fde\u63a5\u8bbe\u7f6e\u6765\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5e94\u8be5\u4f1a\u5931\u8d25\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e\u903b\u8f91\u590d\u5236\u4e0d\u590d\u5236 DDL \u547d\u4ee4\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\u5e94\u907f\u514d\u6267\u884c\u4f1a\u66f4\u6539\u6570\u636e\u5e93\u6a21\u5f0f\u7684 DDL \u547d\u4ee4\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u76f8\u5173 DDL \u53ef\u80fd\u4e0d\u4f1a\u88ab\u590d\u5236\uff0c\u4ece\u800c\u5f15\u53d1\u9519\u8bef\u3002</p>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5904\u7406\u8fc7\u7a0b\u4e2d\u5931\u8d25\uff0c\u4f1a\u5220\u9664\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u5bf9\u8c61\uff08\u53d1\u5e03\u3001\u590d\u5236\u69fd\uff09\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5220\u9664\u53ef\u80fd\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8b66\u544a\u6d88\u606f\u4f1a\u63d0\u793a\u9057\u7559\u7684\u5bf9\u8c61\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u5b83\u4f1a\u88ab\u505c\u6b62\u3002</p>\n<p lang=\"zh\">\u82e5\u590d\u5236\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u5b8c\u6210\u540e\u4f1a\u4ece\u6e90\u670d\u52a1\u5668\u79fb\u9664\u8be5\u590d\u5236\u69fd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u662f\u540c\u6b65\u526f\u672c\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\uff0c\u4e3b\u5e93\u4e0a\u7684\u4e8b\u52a1\u63d0\u4ea4\u53ef\u80fd\u4f1a\u5728\u7b49\u5f85\u590d\u5236\u65f6\u963b\u585e\u3002</p>\n<p lang=\"zh\">\u9664\u975e\u6307\u5b9a<code class=\"option\">--enable-two-phase</code>\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u5728\u7981\u7528\u4e24\u9636\u6bb5\u63d0\u4ea4\u7684\u60c5\u51b5\u4e0b\u5efa\u7acb\u903b\u8f91\u590d\u5236\u3002\u8fd9\u610f\u5473\u7740\u4efb\u4f55\u9884\u5907\u4e8b\u52a1\u90fd\u4f1a\u5728<code class=\"command\">COMMIT PREPARED</code>\u65f6\u88ab\u590d\u5236\uff0c\u800c\u4e0d\u4f1a\u4e8b\u5148\u8fdb\u884c\u9884\u5907\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u8ba2\u9605\uff0c\u5e76\u542f\u7528<a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u4f7f\u7528<span class=\"application\">pg_resetwal</span> \u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u76ee\u6807\u670d\u52a1\u5668\u53ef\u80fd\u4f7f\u7528\u6e90\u670d\u52a1\u5668\u7684 WAL \u6587\u4ef6\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u6709\u5907\u5e93\uff0c\u590d\u5236\u5c06\u4f1a\u4e2d\u65ad\uff0c\u5e94\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u82e5\u7f3a\u5c11\u5fc5\u9700 WAL \u6587\u4ef6\uff0c\u590d\u5236\u53ef\u80fd\u5931\u8d25\u3002\u4e3a\u907f\u514d\u8be5\u95ee\u9898\uff0c\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE\">max_slot_wal_keep_size</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">-1</code>\uff0c\u4ee5\u786e\u4fdd\u5fc5\u9700 WAL \u6587\u4ef6\u4e0d\u4f1a\u88ab\u63d0\u524d\u79fb\u9664\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.4\">\n<h3 lang=\"zh\">\u5de5\u4f5c\u539f\u7406</h3>\n<p lang=\"zh\">\u57fa\u672c\u601d\u8def\u662f\u4ece\u6e90\u670d\u52a1\u5668\u83b7\u5f97\u590d\u5236\u8d77\u70b9\uff0c\u5e76\u4ece\u8be5\u4f4d\u7f6e\u5f00\u59cb\u5efa\u7acb\u903b\u8f91\u590d\u5236\uff1a</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" lang=\"zh\">\n<p>\u4f7f\u7528\u6307\u5b9a\u547d\u4ee4\u884c\u9009\u9879\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u5728\u8fd0\u884c\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u68c0\u67e5\u76ee\u6807\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8f6c\u6362\uff0c\u540c\u65f6\u4e5f\u4f1a\u5bf9\u6e90\u670d\u52a1\u5668\u8fdb\u884c\u4e00\u4e9b\u68c0\u67e5\u3002\u82e5\u4efb\u4e00\u524d\u7f6e\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u521b\u5efa\u4e00\u4e2a\u53d1\u5e03\u548c\u4e00\u4e2a\u590d\u5236\u69fd\u3002\u6bcf\u4e2a\u53d1\u5e03\u90fd\u4ee5<a class=\"link\" href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"><code class=\"literal\">FOR ALL TABLES</code></a>\u521b\u5efa\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--publication</code>\uff0c\u53d1\u5e03\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--replication-slot</code>\uff0c\u590d\u5236\u69fd\u7684\u540d\u79f0\u6a21\u5f0f\u5982\u4e0b\uff1a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8fd9\u4e9b\u590d\u5236\u69fd\u5c06\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u88ab\u8ba2\u9605\u4f7f\u7528\u3002\u6700\u540e\u4e00\u4e2a\u590d\u5236\u69fd\u7684 LSN \u4f1a\u5728<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\u53c2\u6570\u4e2d\u7528\u4f5c\u505c\u6b62\u70b9\uff0c\u4e5f\u4f1a\u88ab\u8ba2\u9605\u7528\u4f5c\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6062\u590d\u53c2\u6570\u5199\u5165\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5e76\u91cd\u542f\u76ee\u6807\u670d\u52a1\u5668\u3002\u5b83\u6307\u5b9a\u4e86\u6062\u590d\u5c06\u63a8\u8fdb\u5230\u7684\u9884\u5199\u5f0f\u65e5\u5fd7\u4f4d\u7f6e\u7684 LSN\uff08<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\uff09\u3002\u5b83\u8fd8\u5c06<code class=\"literal\">promote</code>\u6307\u5b9a\u4e3a\u670d\u52a1\u5668\u5728\u8fbe\u5230\u6062\u590d\u76ee\u6807\u540e\u5e94\u6267\u884c\u7684\u52a8\u4f5c\u3002\u8fd8\u4f1a\u6dfb\u52a0\u5176\u4ed6<a class=\"link\" href=\"/docs/18/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET\" title=\"19.5.6.\u00a0\u6062\u590d\u76ee\u6807\">\u6062\u590d\u53c2\u6570</a>\uff0c\u4ee5\u907f\u514d\u6062\u590d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u610f\u5916\u884c\u4e3a\uff0c\u4f8b\u5982\u4e00\u8fbe\u5230\u4e00\u81f4\u72b6\u6001\u5c31\u7ed3\u675f\u6062\u590d\uff08WAL \u5e94\u7ee7\u7eed\u5e94\u7528\u5230\u590d\u5236\u8d77\u59cb\u4f4d\u7f6e\uff09\uff0c\u6216\u8005\u56e0\u6307\u5b9a\u591a\u4e2a\u6062\u590d\u76ee\u6807\u800c\u5931\u8d25\u3002\u5f53\u670d\u52a1\u5668\u9000\u51fa\u5907\u5e93\u6a21\u5f0f\u5e76\u63a5\u53d7\u8bfb\u5199\u4e8b\u52a1\u65f6\uff0c\u8be5\u6b65\u9aa4\u7ed3\u675f\u3002\u5982\u679c\u8bbe\u7f6e\u4e86<code class=\"option\">--recovery-timeout</code>\u9009\u9879\uff0c\u800c\u6062\u590d\u5728\u7ed9\u5b9a\u79d2\u6570\u5185\u6ca1\u6709\u7ed3\u675f\uff0c<span class=\"application\">pg_createsubscriber</span>\u5c31\u4f1a\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u521b\u5efa\u8ba2\u9605\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--subscription</code>\uff0c\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8be5\u8ba2\u9605\u4e0d\u4f1a\u590d\u5236\u6e90\u670d\u52a1\u5668\u4e0a\u7684\u73b0\u6709\u6570\u636e\uff0c\u4e5f\u4e0d\u4f1a\u521b\u5efa\u590d\u5236\u69fd\uff0c\u800c\u662f\u4f7f\u7528\u524d\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u590d\u5236\u69fd\u3002\u8ba2\u9605\u4f1a\u88ab\u521b\u5efa\uff0c\u4f46\u5c1a\u4e0d\u542f\u7528\uff0c\u56e0\u4e3a\u5fc5\u987b\u5728\u542f\u52a8\u590d\u5236\u4e4b\u524d\u5148\u5c06\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u5230\u590d\u5236\u8d77\u70b9\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5220\u9664\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u88ab\u590d\u5236\u8fc7\u6765\u7684\u53d1\u5e03\uff08\u8fd9\u4e9b\u53d1\u5e03\u662f\u5728\u590d\u5236\u8d77\u70b9\u524d\u521b\u5efa\u7684\uff09\uff0c\u5b83\u4eec\u5728\u8ba2\u9605\u8005\u4e0a\u6ca1\u6709\u7528\u9014\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6bcf\u4e2a\u8ba2\u9605\u7684\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u590d\u5236\u8d77\u70b9\u3002\u5f53\u76ee\u6807\u670d\u52a1\u5668\u5f00\u59cb\u6062\u590d\u8fc7\u7a0b\u65f6\uff0c\u5b83\u4f1a\u8ffd\u8d76\u5230\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6b63\u662f\u6bcf\u4e2a\u8ba2\u9605\u8981\u7528\u4f5c\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u7684 LSN\u3002\u7531\u4e8e\u8ba2\u9605\u5df2\u7ecf\u521b\u5efa\uff0c\u56e0\u6b64\u53ef\u4ee5\u53d6\u5f97\u590d\u5236\u6e90\u540d\u79f0\u3002\u4f7f\u7528\u590d\u5236\u6e90\u540d\u79f0\u548c\u590d\u5236\u8d77\u70b9\u8c03\u7528 <a class=\"link\" href=\"/docs/18/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u4ee5\u8bbe\u7f6e\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u7684\u8ba2\u9605\u3002\u8ba2\u9605\u5c06\u4ece\u590d\u5236\u8d77\u70b9\u5f00\u59cb\u5e94\u7528\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u8be5\u590d\u5236\u69fd\u4e4b\u540e\u4e0d\u518d\u6709\u7528\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u5305\u542b<a class=\"link\" href=\"/docs/18/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS-SYNCHRONIZATION\" title=\"47.2.3.\u00a0\u590d\u5236\u69fd\u540c\u6b65\">\u6545\u969c\u5207\u6362\u590d\u5236\u69fd</a>\uff0c\u5b83\u4eec\u540e\u7eed\u65e0\u6cd5\u7ee7\u7eed\u540c\u6b65\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u66f4\u65b0\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4f1a\u8fd0\u884c<a class=\"xref\" href=\"/docs/18/app-pgresetwal.html\" title=\"pg_resetwal\"><span class=\"refentrytitle\"><span class=\"application\">pg_resetwal</span></span></a>\u6765\u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u7531\u4e8e<code class=\"command\">pg_resetwal</code>\u7684\u8981\u6c42\uff0c\u76ee\u6807\u670d\u52a1\u5668\u4f1a\u88ab\u505c\u6b62\u3002</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u4ece foo \u4e0a\u7684\u7269\u7406\u526f\u672c\u4e3a hr \u548c finance \u6570\u636e\u5e93\u521b\u5efa\u903b\u8f91\u526f\u672c\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_createsubscriber -D /usr/local/pgsql/data -P \"host=foo\" -d hr -d finance</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.9\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"><span class=\"refentrytitle\"><span class=\"application\">pg_basebackup</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgcreatesubscriber.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pgcreatesubscriber.html", "method": "same-major semantic node", "sha256": "04ba2c0c9c94224ef8d8f53af670adcaa704ae7d9f99bd98d03c80b805151d24", "language": "zh", "matched_nodes": ["#APP-PGCREATESUBSCRIBER/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[3]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[4]/p[1]", "#APP-PGCREATESUBSCRIBER/div[4]/p[2]", "#APP-PGCREATESUBSCRIBER/div[4]/p[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[11]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[19]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[21]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/div[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[35]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[9]", "#APP-PGCREATESUBSCRIBER/div[5]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[10]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[7]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[8]/h2[0]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/versions/18/facts/0/label": "Documented executable", "/versions/18/facts/1/label": "Executable version", "/versions/18/facts/2/label": "Reference inventory", "/versions/18/facts/2/value": "Server applications", "/versions/18/facts/3/label": "Option definition groups", "/versions/18/tables/0/title": "Documented options", "/versions/18/tables/0/rows/0/summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "/versions/18/tables/0/rows/1/summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "/versions/18/tables/0/rows/2/summary": "The target directory that contains a cluster directory from a physical replica.", "/versions/18/tables/0/rows/3/summary": "Do everything except actually modifying the target directory.", "/versions/18/tables/0/rows/4/summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "/versions/18/tables/0/rows/5/summary": "The connection string to the publisher. For details see Section 32.1.1 .", "/versions/18/tables/0/rows/6/summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "/versions/18/tables/0/rows/7/summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "/versions/18/tables/0/rows/8/summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "/versions/18/tables/0/rows/9/summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "/versions/18/tables/0/columns/0/label": "Option and arguments", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/0/rows/10/summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/18/tables/0/rows/11/summary": "Drop all objects of the specified type from specified databases on the target server.", "/versions/18/tables/0/rows/12/summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "/versions/18/tables/0/rows/13/summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/14/summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/15/summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/16/summary": "Print the pg_createsubscriber version and exit.", "/versions/18/tables/0/rows/17/summary": "Show help about pg_createsubscriber command line arguments, and exit."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "b9f1baa9f858656d11e787c270b4caccfcd572052a589c3e00fbfae1bc934b65"}, "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "signature": "-d dbname --database= dbname", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "signature": "-n --dry-run", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "signature": "-p port --subscriber-port= port", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "signature": "-P connstr --publisher-server= connstr", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "signature": "-s dir --socketdir= dir", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "signature": "-t seconds --recovery-timeout= seconds", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "signature": "-T --enable-two-phase", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "signature": "-U username --subscriber-username= username", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "signature": "--clean= objtype", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "signature": "--config-file= filename", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "signature": "--publication= name", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all ."}, {"names": ["--replication-slot= name"], "signature": "--replication-slot= name", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "signature": "--subscription= name", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "environment": []}, "comparison_hash": "ab2f9ba9dc71a377cdb3a682c66b1a84f3cb3ae29cb8c1b178c5acc418bc4441", "manual_language": "zh"}, "19": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_createsubscriber"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "19beta4"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "19"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528 --publisher-server \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 postgres \u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 template1 \u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --database \u3001 --publication \u3001 --replication-slot \u6216 --subscription \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-a --all"}}, {"summary": "\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a -d \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e -a \u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b -d \u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece -P \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728 -d \u9009\u9879\u6216 -P \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a -a \u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-d dbname --database= dbname"}}, {"summary": "\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u6307\u5b9a\u65e5\u5fd7\u76ee\u5f55\u7684\u540d\u79f0\u3002\u5982\u679c\u8be5\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u76ee\u5f55\u3002\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u5e26\u65f6\u95f4\u6233\u7684\u5b50\u76ee\u5f55\uff0c\u7528\u4e8e\u6807\u8bc6\u8fd0\u884c pg_createsubscriber \u7684\u65f6\u95f4\u3002\u8be5\u5b50\u76ee\u5f55\u4e2d\u4f1a\u521b\u5efa\u4ee5\u4e0b\u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-l directory --logdir= directory"}}, {"summary": "\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-n --dry-run"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-p port --subscriber-port= port"}}, {"summary": "\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1 \u7b2c 32.1.1 \u8282 \u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-P connstr --publisher-server= connstr"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-s dir --socketdir= dir"}}, {"summary": "\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-t seconds --recovery-timeout= seconds"}}, {"summary": "\u4e3a\u8ba2\u9605\u542f\u7528 two_phase \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a false \u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-T --enable-two-phase"}}, {"summary": "\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-U username --subscriber-username= username"}}, {"summary": "\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f pg_createsubscriber \u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-v --verbose"}}, {"summary": "\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "--clean= objtype"}}, {"summary": "\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002 pg_createsubscriber \u5728\u5185\u90e8\u4f7f\u7528 pg_ctl \u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684 postgresql.conf \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "--config-file= filename"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --publication \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "--publication= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --replication-slot \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "--replication-slot= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --subscription \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "--subscription= name"}}, {"summary": "\u6253\u5370 pg_createsubscriber \u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-V --version"}}, {"summary": "\u663e\u793a pg_createsubscriber \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pgcreatesubscriber.html", "text": "-? --help"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}], "options": [{"names": ["-a", "--all"], "summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "signature": "-a --all", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "signature": "-d dbname --database= dbname", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "The target directory that contains a cluster directory from a physical replica.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-l directory", "--logdir= directory"], "summary": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory.", "signature": "-l directory --logdir= directory", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory. pg_createsubscriber_server.log which captures logs related to stopping and starting the standby server, pg_createsubscriber_internal.log which captures internal diagnostic output (validations, checks, etc.) By default, the umask is set to 077 so that the log files are only readable by the user running the command. However, if the target data directory is configured to allow group-read access, pg_createsubscriber will adjust the log file permissions to match. This ensures that the log file security remains consistent with the database cluster itself."}, {"names": ["-n", "--dry-run"], "summary": "Do everything except actually modifying the target directory.", "signature": "-n --dry-run", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "signature": "-p port --subscriber-port= port", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "summary": "The connection string to the publisher. For details see Section 32.1.1 .", "signature": "-P connstr --publisher-server= connstr", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "signature": "-s dir --socketdir= dir", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "signature": "-t seconds --recovery-timeout= seconds", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "signature": "-T --enable-two-phase", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "signature": "-U username --subscriber-username= username", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "summary": "Drop all objects of the specified type from specified databases on the target server.", "signature": "--clean= objtype", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "signature": "--config-file= filename", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "signature": "--publication= name", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all . If a specified publication already exists on the publisher, it is reused. It is useful to partially replicate the database if the specified publication includes a list of tables. If the publication does not exist, it is automatically created with FOR ALL TABLES . Use --dry-run option to preview which publications will be reused and which will be created."}, {"names": ["--replication-slot= name"], "summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "signature": "--replication-slot= name", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "signature": "--subscription= name", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "summary": "Print the pg_createsubscriber version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_createsubscriber command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-pgcreatesubscriber.html", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/19/postgresql-19-A4.pdf", "bytes": 16064841, "pages": 3052, "sha256": "4dd099e4125c591128fc5f3ebd02178dc24781f9e5ae629f96d67c4c8547427b", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/19/postgresql-19-US.pdf", "bytes": 15974616, "pages": 3225, "sha256": "61971fa857f0956d47341a0388fa6af9ae10acf691d4b2fc009007d384b0342b", "built_at": "2026-09-26"}}, "tree": "19", "index": "index.html", "major": "19", "pages": 1155, "release": "19beta4", "source_url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "svg_assets": 5, "source_mode": "en SGML built with pinned official archive", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "revision": "1bbbbf4133d426f0e4304010688d2984c30fb67df0cc3a61b3e37eb3f6f37833", "evidence_kind": "English manual and source declarations", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "sources": [{"url": "https://pg.center/docs/19/app-pgcreatesubscriber.html", "file": "app-pgcreatesubscriber.html", "label": "19beta4 English manual \u00b7 app-pgcreatesubscriber.html", "anchor": "", "sha256": "b80fa11097ac7787e12ec63969d98dbf47c367fddcc5edc87271f213dd4a07df", "language": "en", "original_url": "/docs/19/app-pgcreatesubscriber.html"}, {"url": "https://pg.center/docs/19/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "425b070323b448b5516d2cb4e9e4ac77efb5d19dd4e8005d0ae1c61db9ec78e6", "language": "en", "original_url": "/docs/19/reference-server.html"}], "sections": [], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "signature": "pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr", "description": ["pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCREATESUBSCRIBER\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_createsubscriber</span></span></h2>\n<p lang=\"zh\">pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.1\"><code class=\"command\">pg_createsubscriber</code> [<em class=\"replaceable\"><code>option</code></em>...] { <code class=\"option\">-d</code> | <code class=\"option\">--database</code> } <em class=\"replaceable\"><code>dbname</code></em> { <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> } <em class=\"replaceable\"><code>datadir</code></em> { <code class=\"option\">-P</code> | <code class=\"option\">--publisher-server</code> } <em class=\"replaceable\"><code>connstr</code></em></p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4ece\u7269\u7406\u5907\u5e93\u521b\u5efa\u65b0\u7684\u903b\u8f91\u526f\u672c\u3002\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u90fd\u4f1a\u5305\u542b\u5728<a class=\"link\" href=\"/docs/19/logical-replication.html\" title=\"\u7b2c\u00a029\u00a0\u7ae0\u00a0\u903b\u8f91\u590d\u5236\">\u903b\u8f91\u590d\u5236</a>\u914d\u7f6e\u4e2d\u3002\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u4f1a\u521b\u5efa\u4e00\u5bf9\u53d1\u5e03\u548c\u8ba2\u9605\u5bf9\u8c61\u3002\u8be5\u5de5\u5177\u5fc5\u987b\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002</p>\n<p lang=\"zh\">\u6210\u529f\u8fd0\u884c\u540e\uff0c\u76ee\u6807\u670d\u52a1\u5668\u7684\u72b6\u6001\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u65b0\u7684\u903b\u8f91\u590d\u5236\u914d\u7f6e\u3002\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e0e<span class=\"application\">pg_createsubscriber</span>\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u6570\u636e\u540c\u6b65\u7684\u5b8c\u6210\u65b9\u5f0f\u3002<span class=\"application\">pg_createsubscriber</span> \u4e0d\u4f1a\u590d\u5236\u521d\u59cb\u8868\u6570\u636e\u3002\u5b83\u53ea\u6267\u884c\u540c\u6b65\u9636\u6bb5\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u8868\u90fd\u8fbe\u5230\u540c\u6b65\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4e3b\u8981\u9762\u5411\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e2d\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u590d\u5236\u521d\u59cb\u6570\u636e\u4e0a\u3002\u6b64\u5916\uff0c\u5728\u6570\u636e\u540c\u6b65\u4e0a\u82b1\u8d39\u8f83\u957f\u65f6\u95f4\u7684\u4e00\u4e2a\u526f\u4f5c\u7528\u901a\u5e38\u662f\uff0c\u4f1a\u6709\u5927\u91cf\u5728\u521d\u59cb\u6570\u636e\u590d\u5236\u671f\u95f4\u4ea7\u751f\u7684\u66f4\u6539\u9700\u8981\u5e94\u7528\uff0c\u8fd9\u4f1a\u8fdb\u4e00\u6b65\u5ef6\u540e\u903b\u8f91\u526f\u672c\u53ef\u7528\u7684\u65f6\u95f4\u3002\u5bf9\u4e8e\u8f83\u5c0f\u7684\u6570\u636e\u5e93\uff0c\u5efa\u8bae\u5efa\u7acb\u5e26\u521d\u59cb\u6570\u636e\u540c\u6b65\u7684\u903b\u8f91\u590d\u5236\u3002\u8be6\u89c1<code class=\"command\">CREATE SUBSCRIPTION</code>\u7684 <a class=\"link\" href=\"/docs/19/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-COPY-DATA\"><code class=\"literal\">copy_data</code></a>\u9009\u9879\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.6\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528<code class=\"option\">--publisher-server</code> \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">postgres</code>\u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">template1</code>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">--database</code>\u3001<code class=\"option\">--publication</code>\u3001<code class=\"option\">--replication-slot</code>\u6216<code class=\"option\">--subscription</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">-d</code> \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-a</code>\u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b<code class=\"option\">-d</code>\u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728<code class=\"option\">-d</code>\u9009\u9879\u6216<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a<code class=\"option\">-a</code>\u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>directory</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--logdir=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u65e5\u5fd7\u76ee\u5f55\u7684\u540d\u79f0\u3002\u5982\u679c\u8be5\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u76ee\u5f55\u3002\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u5e26\u65f6\u95f4\u6233\u7684\u5b50\u76ee\u5f55\uff0c\u7528\u4e8e\u6807\u8bc6\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span> \u7684\u65f6\u95f4\u3002\u8be5\u5b50\u76ee\u5f55\u4e2d\u4f1a\u521b\u5efa\u4ee5\u4e0b\u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"filename\">pg_createsubscriber_server.log</code>\uff1a\u8bb0\u5f55\u4e0e\u505c\u6b62\u548c\u542f\u52a8\u5907\u5e93\u76f8\u5173\u7684\u65e5\u5fd7\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"filename\">pg_createsubscriber_internal.log</code>\uff1a\u8bb0\u5f55\u5185\u90e8\u8bca\u65ad\u8f93\u51fa\uff08\u6821\u9a8c\u3001\u68c0\u67e5\u7b49\uff09\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"systemitem\">umask</span> \u8bbe\u4e3a 077\uff0c\u56e0\u6b64\u65e5\u5fd7\u6587\u4ef6\u53ea\u6709\u8fd0\u884c\u8be5\u547d\u4ee4\u7684\u7528\u6237\u53ef\u8bfb\u3002\u4e0d\u8fc7\uff0c\u5982\u679c\u76ee\u6807\u6570\u636e\u76ee\u5f55\u914d\u7f6e\u4e3a\u5141\u8bb8\u7ec4\u8bfb\u8bbf\u95ee\uff0c<span class=\"application\">pg_createsubscriber</span> \u4f1a\u8c03\u6574\u65e5\u5fd7\u6587\u4ef6\u6743\u9650\u4ee5\u5339\u914d\u3002\u8fd9\u786e\u4fdd\u65e5\u5fd7\u6587\u4ef6\u7684\u5b89\u5168\u6027\u4e0e\u6570\u636e\u5e93\u96c6\u7c07\u672c\u8eab\u4fdd\u6301\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code><br/></span><span class=\"term\"><code class=\"option\">--dry-run</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>connstr</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--publisher-server=<em class=\"replaceable\"><code>connstr</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1<a class=\"xref\" href=\"/docs/19/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u7b2c\u00a032.1.1\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>dir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--socketdir=<em class=\"replaceable\"><code>dir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--recovery-timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code><br/></span><span class=\"term\"><code class=\"option\">--enable-two-phase</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u8ba2\u9605\u542f\u7528 <a class=\"link\" href=\"/docs/19/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">false</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f <span class=\"application\">pg_createsubscriber</span>\u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--clean=<em class=\"replaceable\"><code>objtype</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<ul class=\"itemizedlist\" style=\"list-style-type: disc;\">\n<li class=\"listitem\">\n<p><code class=\"literal\">publications</code>\uff1a\u4e3a\u8be5\u8ba2\u9605\u8005\u5efa\u7acb\u7684<code class=\"literal\">FOR ALL TABLES</code>\u53d1\u5e03\u603b\u662f\u4f1a\u88ab\u5220\u9664\uff1b\u6307\u5b9a\u6b64\u5bf9\u8c61\u7c7b\u578b\u8fd8\u4f1a\u5220\u9664\u4ece\u6e90\u670d\u52a1\u5668\u590d\u5236\u8fc7\u6765\u7684\u5176\u4ed6\u6240\u6709\u53d1\u5e03\u3002</p>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u88ab\u9009\u4e2d\u8981\u5220\u9664\u7684\u5bf9\u8c61\u90fd\u4f1a\u9010\u4e2a\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\uff0c\u5305\u62ec\u5728<code class=\"option\">--dry-run</code> \u671f\u95f4\u4e5f\u662f\u5982\u6b64\u3002\u6ca1\u6709\u673a\u4f1a\u5e72\u9884\u6216\u505c\u6b62\u8fd9\u4e9b\u5bf9\u8c61\u7684\u5220\u9664\uff0c\u56e0\u6b64\u53ef\u4ee5\u8003\u8651\u4f7f\u7528 <span class=\"application\">pg_dump</span>\u5148\u5bf9\u5b83\u4eec\u8fdb\u884c\u5907\u4efd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--config-file=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<span class=\"application\">pg_createsubscriber</span>\u5728\u5185\u90e8\u4f7f\u7528 <span class=\"application\">pg_ctl</span>\u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684<code class=\"filename\">postgresql.conf</code>\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--publication=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--publication</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u53d1\u5e03\u5df2\u7ecf\u5b58\u5728\u4e8e\u53d1\u5e03\u8005\u4e0a\uff0c\u5219\u4f1a\u590d\u7528\u5b83\u3002\u5982\u679c\u6307\u5b9a\u7684\u53d1\u5e03\u5305\u542b\u4e00\u4e2a\u8868\u5217\u8868\uff0c\u90a3\u4e48\u8fd9\u5bf9\u90e8\u5206\u590d\u5236\u6570\u636e\u5e93\u5f88\u6709\u7528\u3002\u5982\u679c\u8be5\u53d1\u5e03\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u81ea\u52a8\u4ee5 <code class=\"literal\">FOR ALL TABLES</code> \u521b\u5efa\u5b83\u3002\u4f7f\u7528<code class=\"option\">--dry-run</code> \u9009\u9879\u53ef\u4ee5\u9884\u89c8\u54ea\u4e9b\u53d1\u5e03\u4f1a\u88ab\u590d\u7528\u3001\u54ea\u4e9b\u4f1a\u88ab\u521b\u5efa\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--replication-slot=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--replication-slot</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--subscription=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--subscription</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_createsubscriber</span>\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a<span class=\"application\">pg_createsubscriber</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.2\">\n<h3 lang=\"zh\">\u524d\u7f6e\u6761\u4ef6</h3>\n<p lang=\"zh\">\u8981\u8ba9<span class=\"application\">pg_createsubscriber</span>\u5c06\u76ee\u6807\u670d\u52a1\u5668\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u9700\u8981\u6ee1\u8db3\u4e00\u4e9b\u524d\u63d0\u6761\u4ef6\u3002\u5982\u679c\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u5c31\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u6e90\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7684\u4e3b\u7248\u672c\u5fc5\u987b\u4e0e <span class=\"application\">pg_createsubscriber</span>\u76f8\u540c\u3002\u7ed9\u5b9a\u7684\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5fc5\u987b\u4e0e\u6e90\u6570\u636e\u76ee\u5f55\u5177\u6709\u76f8\u540c\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u6307\u5b9a\u7684\u6570\u636e\u5e93\u7528\u6237\u5fc5\u987b\u5177\u5907\u521b\u5efa<a class=\"link\" href=\"/docs/19/sql-createsubscription.html\" title=\"CREATE SUBSCRIPTION\">\u8ba2\u9605</a>\u4ee5\u53ca\u4f7f\u7528<a class=\"link\" href=\"/docs/19/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u7684\u6743\u9650\u3002</p>\n<p lang=\"zh\">\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u4f5c\u4e3a\u7269\u7406\u5907\u5e93\u4f7f\u7528\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-MAX-ACTIVE-REPLICATION-ORIGINS\">max_active_replication_origins</a>\u548c<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS\">max_logical_replication_workers</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u5982\u679c\u8ba1\u5212\u4f7f\u7528<code class=\"option\">--enable-two-phase</code> \u5f00\u5173\uff0c\u8fd8\u9700\u8981\u9002\u5f53\u5730\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/19/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS\">max_prepared_transactions</a>\u3002</p>\n<p lang=\"zh\">\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u6765\u81ea\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u6e90\u670d\u52a1\u5668\u4e0d\u80fd\u5904\u4e8e\u6062\u590d\u4e2d\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-wal.html#GUC-WAL-LEVEL\">wal_level</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">replica</code>\u6216 <code class=\"literal\">logical</code>\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u52a0\u73b0\u6709\u590d\u5236\u69fd\u6570\u91cf\u7684\u503c\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\">max_wal_senders</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u4e0e\u73b0\u6709 WAL \u53d1\u9001\u8fdb\u7a0b\u6570\u91cf\u4e4b\u548c\u7684\u503c\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.3\">\n<h3 lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5728\u76ee\u6807\u670d\u52a1\u5668\u88ab\u63d0\u5347\u540e\u5931\u8d25\uff0c\u6570\u636e\u76ee\u5f55\u5f88\u53ef\u80fd\u5df2\u5904\u4e8e\u4e0d\u53ef\u6062\u590d\u72b6\u6001\u3002\u6b64\u65f6\u5efa\u8bae\u91cd\u65b0\u521b\u5efa\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c<span class=\"application\">pg_createsubscriber</span>\u901a\u5e38\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u8fde\u63a5\u8bbe\u7f6e\u6765\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5e94\u8be5\u4f1a\u5931\u8d25\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e\u903b\u8f91\u590d\u5236\u4e0d\u590d\u5236 DDL \u547d\u4ee4\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\u5e94\u907f\u514d\u6267\u884c\u4f1a\u66f4\u6539\u6570\u636e\u5e93\u6a21\u5f0f\u7684 DDL \u547d\u4ee4\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u76f8\u5173 DDL \u53ef\u80fd\u4e0d\u4f1a\u88ab\u590d\u5236\uff0c\u4ece\u800c\u5f15\u53d1\u9519\u8bef\u3002</p>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5904\u7406\u8fc7\u7a0b\u4e2d\u5931\u8d25\uff0c\u4f1a\u5220\u9664\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u5bf9\u8c61\uff08\u53d1\u5e03\u3001\u590d\u5236\u69fd\uff09\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5220\u9664\u53ef\u80fd\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8b66\u544a\u6d88\u606f\u4f1a\u63d0\u793a\u9057\u7559\u7684\u5bf9\u8c61\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u5b83\u4f1a\u88ab\u505c\u6b62\u3002</p>\n<p lang=\"zh\">\u82e5\u590d\u5236\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u5b8c\u6210\u540e\u4f1a\u4ece\u6e90\u670d\u52a1\u5668\u79fb\u9664\u8be5\u590d\u5236\u69fd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u662f\u540c\u6b65\u526f\u672c\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\uff0c\u4e3b\u5e93\u4e0a\u7684\u4e8b\u52a1\u63d0\u4ea4\u53ef\u80fd\u4f1a\u5728\u7b49\u5f85\u590d\u5236\u65f6\u963b\u585e\u3002</p>\n<p lang=\"zh\">\u9664\u975e\u6307\u5b9a<code class=\"option\">--enable-two-phase</code>\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u5728\u7981\u7528\u4e24\u9636\u6bb5\u63d0\u4ea4\u7684\u60c5\u51b5\u4e0b\u5efa\u7acb\u903b\u8f91\u590d\u5236\u3002\u8fd9\u610f\u5473\u7740\u4efb\u4f55\u9884\u5907\u4e8b\u52a1\u90fd\u4f1a\u5728<code class=\"command\">COMMIT PREPARED</code>\u65f6\u88ab\u590d\u5236\uff0c\u800c\u4e0d\u4f1a\u4e8b\u5148\u8fdb\u884c\u9884\u5907\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u8ba2\u9605\uff0c\u5e76\u542f\u7528<a class=\"link\" href=\"/docs/19/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u4f7f\u7528<span class=\"application\">pg_resetwal</span> \u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u76ee\u6807\u670d\u52a1\u5668\u53ef\u80fd\u4f7f\u7528\u6e90\u670d\u52a1\u5668\u7684 WAL \u6587\u4ef6\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u6709\u5907\u5e93\uff0c\u590d\u5236\u5c06\u4f1a\u4e2d\u65ad\uff0c\u5e94\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u82e5\u7f3a\u5c11\u5fc5\u9700 WAL \u6587\u4ef6\uff0c\u590d\u5236\u53ef\u80fd\u5931\u8d25\u3002\u4e3a\u907f\u514d\u8be5\u95ee\u9898\uff0c\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE\">max_slot_wal_keep_size</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">-1</code>\uff0c\u4ee5\u786e\u4fdd\u5fc5\u9700 WAL \u6587\u4ef6\u4e0d\u4f1a\u88ab\u63d0\u524d\u79fb\u9664\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.4\">\n<h3 lang=\"zh\">\u5de5\u4f5c\u539f\u7406</h3>\n<p lang=\"zh\">\u57fa\u672c\u601d\u8def\u662f\u4ece\u6e90\u670d\u52a1\u5668\u83b7\u5f97\u590d\u5236\u8d77\u70b9\uff0c\u5e76\u4ece\u8be5\u4f4d\u7f6e\u5f00\u59cb\u5efa\u7acb\u903b\u8f91\u590d\u5236\uff1a</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" lang=\"zh\">\n<p>\u4f7f\u7528\u6307\u5b9a\u547d\u4ee4\u884c\u9009\u9879\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u5728\u8fd0\u884c\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u68c0\u67e5\u76ee\u6807\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8f6c\u6362\uff0c\u540c\u65f6\u4e5f\u4f1a\u5bf9\u6e90\u670d\u52a1\u5668\u8fdb\u884c\u4e00\u4e9b\u68c0\u67e5\u3002\u82e5\u4efb\u4e00\u524d\u7f6e\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u521b\u5efa\u4e00\u4e2a\u53d1\u5e03\u548c\u4e00\u4e2a\u590d\u5236\u69fd\u3002\u6bcf\u4e2a\u53d1\u5e03\u90fd\u4ee5<a class=\"link\" href=\"/docs/19/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"><code class=\"literal\">FOR ALL TABLES</code></a>\u521b\u5efa\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--publication</code>\uff0c\u53d1\u5e03\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--replication-slot</code>\uff0c\u590d\u5236\u69fd\u7684\u540d\u79f0\u6a21\u5f0f\u5982\u4e0b\uff1a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8fd9\u4e9b\u590d\u5236\u69fd\u5c06\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u88ab\u8ba2\u9605\u4f7f\u7528\u3002\u6700\u540e\u4e00\u4e2a\u590d\u5236\u69fd\u7684 LSN \u4f1a\u5728<a class=\"xref\" href=\"/docs/19/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\u53c2\u6570\u4e2d\u7528\u4f5c\u505c\u6b62\u70b9\uff0c\u4e5f\u4f1a\u88ab\u8ba2\u9605\u7528\u4f5c\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6062\u590d\u53c2\u6570\u5199\u5165\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u72ec\u7acb\u914d\u7f6e\u6587\u4ef6 <code class=\"filename\">pg_createsubscriber.conf</code>\uff0c\u8be5\u6587\u4ef6\u901a\u8fc7\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4e2d\u7684 <code class=\"filename\">postgresql.auto.conf</code> \u91cc\u7684 <code class=\"literal\">include_if_exists</code> \u5f15\u5165\uff0c\u7136\u540e\u91cd\u542f\u76ee\u6807\u670d\u52a1\u5668\u3002\u5b83\u6307\u5b9a\u4e86\u6062\u590d\u5c06\u63a8\u8fdb\u5230\u7684\u9884\u5199\u5f0f\u65e5\u5fd7\u4f4d\u7f6e\u7684 LSN\uff08<a class=\"xref\" href=\"/docs/19/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\uff09\u3002\u5b83\u8fd8\u5c06<code class=\"literal\">promote</code>\u6307\u5b9a\u4e3a\u670d\u52a1\u5668\u5728\u8fbe\u5230\u6062\u590d\u76ee\u6807\u540e\u5e94\u6267\u884c\u7684\u52a8\u4f5c\u3002\u8fd8\u4f1a\u6dfb\u52a0\u5176\u4ed6<a class=\"link\" href=\"/docs/19/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET\" title=\"19.5.6.\u00a0\u6062\u590d\u76ee\u6807\">\u6062\u590d\u53c2\u6570</a>\uff0c\u4ee5\u907f\u514d\u6062\u590d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u610f\u5916\u884c\u4e3a\uff0c\u4f8b\u5982\u4e00\u8fbe\u5230\u4e00\u81f4\u72b6\u6001\u5c31\u7ed3\u675f\u6062\u590d\uff08WAL \u5e94\u7ee7\u7eed\u5e94\u7528\u5230\u590d\u5236\u8d77\u59cb\u4f4d\u7f6e\uff09\uff0c\u6216\u8005\u56e0\u6307\u5b9a\u591a\u4e2a\u6062\u590d\u76ee\u6807\u800c\u5931\u8d25\u3002\u5f53\u670d\u52a1\u5668\u9000\u51fa\u5907\u5e93\u6a21\u5f0f\u5e76\u63a5\u53d7\u8bfb\u5199\u4e8b\u52a1\u65f6\uff0c\u8be5\u6b65\u9aa4\u7ed3\u675f\u3002\u5982\u679c\u8bbe\u7f6e\u4e86<code class=\"option\">--recovery-timeout</code>\u9009\u9879\uff0c\u800c\u6062\u590d\u5728\u7ed9\u5b9a\u79d2\u6570\u5185\u6ca1\u6709\u7ed3\u675f\uff0c<span class=\"application\">pg_createsubscriber</span>\u5c31\u4f1a\u7ec8\u6b62\u3002\u5b8c\u6210\u540e\uff0c\u88ab\u5305\u542b\u7684\u914d\u7f6e\u6587\u4ef6\u4f1a\u91cd\u547d\u540d\u4e3a <code class=\"filename\">pg_createsubscriber.conf.disabled</code>\uff0c\u4f7f\u5176\u4e0d\u518d\u5728\u540e\u7eed\u91cd\u542f\u65f6\u52a0\u8f7d\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u521b\u5efa\u8ba2\u9605\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--subscription</code>\uff0c\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8be5\u8ba2\u9605\u4e0d\u4f1a\u590d\u5236\u6e90\u670d\u52a1\u5668\u4e0a\u7684\u73b0\u6709\u6570\u636e\uff0c\u4e5f\u4e0d\u4f1a\u521b\u5efa\u590d\u5236\u69fd\uff0c\u800c\u662f\u4f7f\u7528\u524d\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u590d\u5236\u69fd\u3002\u8ba2\u9605\u4f1a\u88ab\u521b\u5efa\uff0c\u4f46\u5c1a\u4e0d\u542f\u7528\uff0c\u56e0\u4e3a\u5fc5\u987b\u5728\u542f\u52a8\u590d\u5236\u4e4b\u524d\u5148\u5c06\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u5230\u590d\u5236\u8d77\u70b9\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5220\u9664\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u88ab\u590d\u5236\u8fc7\u6765\u7684\u53d1\u5e03\uff08\u8fd9\u4e9b\u53d1\u5e03\u662f\u5728\u590d\u5236\u8d77\u70b9\u524d\u521b\u5efa\u7684\uff09\uff0c\u5b83\u4eec\u5728\u8ba2\u9605\u8005\u4e0a\u6ca1\u6709\u7528\u9014\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6bcf\u4e2a\u8ba2\u9605\u7684\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u590d\u5236\u8d77\u70b9\u3002\u5f53\u76ee\u6807\u670d\u52a1\u5668\u5f00\u59cb\u6062\u590d\u8fc7\u7a0b\u65f6\uff0c\u5b83\u4f1a\u8ffd\u8d76\u5230\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6b63\u662f\u6bcf\u4e2a\u8ba2\u9605\u8981\u7528\u4f5c\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u7684 LSN\u3002\u7531\u4e8e\u8ba2\u9605\u5df2\u7ecf\u521b\u5efa\uff0c\u56e0\u6b64\u53ef\u4ee5\u53d6\u5f97\u590d\u5236\u6e90\u540d\u79f0\u3002\u4f7f\u7528\u590d\u5236\u6e90\u540d\u79f0\u548c\u590d\u5236\u8d77\u70b9\u8c03\u7528 <a class=\"link\" href=\"/docs/19/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u4ee5\u8bbe\u7f6e\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u7684\u8ba2\u9605\u3002\u8ba2\u9605\u5c06\u4ece\u590d\u5236\u8d77\u70b9\u5f00\u59cb\u5e94\u7528\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/19/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u8be5\u590d\u5236\u69fd\u4e4b\u540e\u4e0d\u518d\u6709\u7528\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u5305\u542b<a class=\"link\" href=\"/docs/19/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS-SYNCHRONIZATION\" title=\"47.2.3.\u00a0\u590d\u5236\u69fd\u540c\u6b65\">\u6545\u969c\u5207\u6362\u590d\u5236\u69fd</a>\uff0c\u5b83\u4eec\u540e\u7eed\u65e0\u6cd5\u7ee7\u7eed\u540c\u6b65\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u66f4\u65b0\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4f1a\u8fd0\u884c<a class=\"xref\" href=\"/docs/19/app-pgresetwal.html\" title=\"pg_resetwal\"><span class=\"refentrytitle\"><span class=\"application\">pg_resetwal</span></span></a>\u6765\u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u7531\u4e8e<code class=\"command\">pg_resetwal</code>\u7684\u8981\u6c42\uff0c\u76ee\u6807\u670d\u52a1\u5668\u4f1a\u88ab\u505c\u6b62\u3002</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u4ece foo \u4e0a\u7684\u7269\u7406\u526f\u672c\u4e3a hr \u548c finance \u6570\u636e\u5e93\u521b\u5efa\u903b\u8f91\u526f\u672c\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_createsubscriber -D /usr/local/pgsql/data -P \"host=foo\" -d hr -d finance</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.9\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/19/app-pgbasebackup.html\" title=\"pg_basebackup\"><span class=\"refentrytitle\"><span class=\"application\">pg_basebackup</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgcreatesubscriber.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/app-pgcreatesubscriber.html", "method": "same-major semantic node", "sha256": "a727c3305e85498548ea9b4717a10961670db702bf2c8c0c711a52fbdc723cd9", "language": "zh", "matched_nodes": ["#APP-PGCREATESUBSCRIBER/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[3]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[4]/p[1]", "#APP-PGCREATESUBSCRIBER/div[4]/p[2]", "#APP-PGCREATESUBSCRIBER/div[4]/p[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[11]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[19]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[21]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/div[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]/p[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[35]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[37]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/div[1]/ul[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/div[1]/ul[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[9]", "#APP-PGCREATESUBSCRIBER/div[5]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[10]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[7]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[8]/h2[0]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/versions/19/facts/0/label": "Documented executable", "/versions/19/facts/1/label": "Executable version", "/versions/19/facts/2/label": "Reference inventory", "/versions/19/facts/2/value": "Server applications", "/versions/19/facts/3/label": "Option definition groups", "/versions/19/tables/0/title": "Documented options", "/versions/19/tables/0/rows/0/summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "/versions/19/tables/0/rows/1/summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "/versions/19/tables/0/rows/2/summary": "The target directory that contains a cluster directory from a physical replica.", "/versions/19/tables/0/rows/3/summary": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory.", "/versions/19/tables/0/rows/4/summary": "Do everything except actually modifying the target directory.", "/versions/19/tables/0/rows/5/summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "/versions/19/tables/0/rows/6/summary": "The connection string to the publisher. For details see Section 32.1.1 .", "/versions/19/tables/0/rows/7/summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "/versions/19/tables/0/rows/8/summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "/versions/19/tables/0/rows/9/summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "/versions/19/tables/0/columns/0/label": "Option and arguments", "/versions/19/tables/0/columns/1/label": "Description", "/versions/19/tables/0/rows/10/summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "/versions/19/tables/0/rows/11/summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/19/tables/0/rows/12/summary": "Drop all objects of the specified type from specified databases on the target server.", "/versions/19/tables/0/rows/13/summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "/versions/19/tables/0/rows/14/summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "/versions/19/tables/0/rows/15/summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "/versions/19/tables/0/rows/16/summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "/versions/19/tables/0/rows/17/summary": "Print the pg_createsubscriber version and exit.", "/versions/19/tables/0/rows/18/summary": "Show help about pg_createsubscriber command line arguments, and exit."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "40b61ffcc21fbf1bd0eb39e779e5ce2746016c5c6b527b47a19502ec96b4097d"}, "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "signature": "-d dbname --database= dbname", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-l directory", "--logdir= directory"], "signature": "-l directory --logdir= directory", "description": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory. pg_createsubscriber_server.log which captures logs related to stopping and starting the standby server, pg_createsubscriber_internal.log which captures internal diagnostic output (validations, checks, etc.) By default, the umask is set to 077 so that the log files are only readable by the user running the command. However, if the target data directory is configured to allow group-read access, pg_createsubscriber will adjust the log file permissions to match. This ensures that the log file security remains consistent with the database cluster itself."}, {"names": ["-n", "--dry-run"], "signature": "-n --dry-run", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "signature": "-p port --subscriber-port= port", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "signature": "-P connstr --publisher-server= connstr", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "signature": "-s dir --socketdir= dir", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "signature": "-t seconds --recovery-timeout= seconds", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "signature": "-T --enable-two-phase", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "signature": "-U username --subscriber-username= username", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "signature": "--clean= objtype", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "signature": "--config-file= filename", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "signature": "--publication= name", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all . If a specified publication already exists on the publisher, it is reused. It is useful to partially replicate the database if the specified publication includes a list of tables. If the publication does not exist, it is automatically created with FOR ALL TABLES . Use --dry-run option to preview which publications will be reused and which will be created."}, {"names": ["--replication-slot= name"], "signature": "--replication-slot= name", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "signature": "--subscription= name", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "environment": []}, "comparison_hash": "b4807e2c2ddbf51e9e6cdd5c6c5a1cd58c95530174f72f8e053b38ce95c721d8", "manual_language": "zh"}, "20": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_createsubscriber"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "20devel"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "19"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u4e86\u83b7\u53d6\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528 --publisher-server \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 postgres \u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 template1 \u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --database \u3001 --publication \u3001 --replication-slot \u6216 --subscription \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-a --all"}}, {"summary": "\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a -d \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e -a \u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b -d \u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece -P \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728 -d \u9009\u9879\u6216 -P \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a -a \u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-d dbname --database= dbname"}}, {"summary": "\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u6307\u5b9a\u65e5\u5fd7\u76ee\u5f55\u7684\u540d\u79f0\u3002\u5982\u679c\u8be5\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u76ee\u5f55\u3002\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u5e26\u65f6\u95f4\u6233\u7684\u5b50\u76ee\u5f55\uff0c\u7528\u4e8e\u6807\u8bc6\u8fd0\u884c pg_createsubscriber \u7684\u65f6\u95f4\u3002\u8be5\u5b50\u76ee\u5f55\u4e2d\u4f1a\u521b\u5efa\u4ee5\u4e0b\u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-l directory --logdir= directory"}}, {"summary": "\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-n --dry-run"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-p port --subscriber-port= port"}}, {"summary": "\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1 \u7b2c 32.1.1 \u8282 \u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-P connstr --publisher-server= connstr"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-s dir --socketdir= dir"}}, {"summary": "\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-t seconds --recovery-timeout= seconds"}}, {"summary": "\u4e3a\u8ba2\u9605\u542f\u7528 two_phase \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a false \u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-T --enable-two-phase"}}, {"summary": "\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-U username --subscriber-username= username"}}, {"summary": "\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f pg_createsubscriber \u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-v --verbose"}}, {"summary": "\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "--clean= objtype"}}, {"summary": "\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002 pg_createsubscriber \u5728\u5185\u90e8\u4f7f\u7528 pg_ctl \u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684 postgresql.conf \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "--config-file= filename"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --publication \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "--publication= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --replication-slot \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "--replication-slot= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --subscription \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "--subscription= name"}}, {"summary": "\u6253\u5370 pg_createsubscriber \u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-V --version"}}, {"summary": "\u663e\u793a pg_createsubscriber \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pgcreatesubscriber.html", "text": "-? --help"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}], "options": [{"names": ["-a", "--all"], "summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "signature": "-a --all", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "signature": "-d dbname --database= dbname", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "The target directory that contains a cluster directory from a physical replica.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-l directory", "--logdir= directory"], "summary": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory.", "signature": "-l directory --logdir= directory", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory. pg_createsubscriber_server.log which captures logs related to stopping and starting the standby server, pg_createsubscriber_internal.log which captures internal diagnostic output (validations, checks, etc.) By default, the umask is set to 077 so that the log files are only readable by the user running the command. However, if the target data directory is configured to allow group-read access, pg_createsubscriber will adjust the log file permissions to match. This ensures that the log file security remains consistent with the database cluster itself."}, {"names": ["-n", "--dry-run"], "summary": "Do everything except actually modifying the target directory.", "signature": "-n --dry-run", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "signature": "-p port --subscriber-port= port", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "summary": "The connection string to the publisher. For details see Section 32.1.1 .", "signature": "-P connstr --publisher-server= connstr", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "signature": "-s dir --socketdir= dir", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "signature": "-t seconds --recovery-timeout= seconds", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "signature": "-T --enable-two-phase", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "signature": "-U username --subscriber-username= username", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "summary": "Drop all objects of the specified type from specified databases on the target server.", "signature": "--clean= objtype", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "signature": "--config-file= filename", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "signature": "--publication= name", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all . If a specified publication already exists on the publisher, it is reused. It is useful to partially replicate the database if the specified publication includes a list of tables. If the publication does not exist, it is automatically created with FOR ALL TABLES . Use --dry-run option to preview which publications will be reused and which will be created."}, {"names": ["--replication-slot= name"], "summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "signature": "--replication-slot= name", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "signature": "--subscription= name", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "summary": "Print the pg_createsubscriber version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_createsubscriber command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-pgcreatesubscriber.html", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/20/postgresql-20-A4.pdf", "bytes": 16030631, "pages": 3052, "sha256": "bd5d82c0ce38fc18f92a0447818a91a193a261776bca1c37564bf9a683e177d0", "built_at": "2026-09-28"}, "US": {"url": "/files/documentation/pdf/20/postgresql-20-US.pdf", "bytes": 15936613, "pages": 3223, "sha256": "d97d9e0db479a02f4234b175f50fcad70c3661619afc8d6df9b9437882e3c299", "built_at": "2026-09-28"}}, "tree": "0", "index": "index.html", "major": "20", "pages": 1156, "release": "20devel", "source_url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "svg_assets": 6, "source_mode": "en SGML built with pinned official archive", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_snapshot_utc": "26-Sep-2026 20:22"}, "revision": "2eba5e0fd4c3bffb2803247b6cd537878e9d6ee5a6dfbe3c50ece8b421b80918", "evidence_kind": "English manual and source declarations", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, "sources": [{"url": "https://pg.center/docs/devel/app-pgcreatesubscriber.html", "file": "app-pgcreatesubscriber.html", "label": "20devel English manual \u00b7 app-pgcreatesubscriber.html", "anchor": "", "sha256": "55e90fc7b3d88304ec0ec7d8793a2f0993d82a397b09d5436ec2637e3aa47ba3", "language": "en", "original_url": "/docs/devel/app-pgcreatesubscriber.html"}, {"url": "https://pg.center/docs/devel/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "5532c1ebfb8c6f310301be63a28daf0ae212e2a78025bea61a1bdca99e02c43d", "language": "en", "original_url": "/docs/devel/reference-server.html"}], "sections": [], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "signature": "pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr", "description": ["pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCREATESUBSCRIBER\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_createsubscriber</span></span></h2>\n<p lang=\"zh\">pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.1\"><code class=\"command\">pg_createsubscriber</code> [<em class=\"replaceable\"><code>option</code></em>...] { <code class=\"option\">-d</code> | <code class=\"option\">--database</code> } <em class=\"replaceable\"><code>dbname</code></em> { <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> } <em class=\"replaceable\"><code>datadir</code></em> { <code class=\"option\">-P</code> | <code class=\"option\">--publisher-server</code> } <em class=\"replaceable\"><code>connstr</code></em></p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4ece\u7269\u7406\u5907\u5e93\u521b\u5efa\u65b0\u7684\u903b\u8f91\u526f\u672c\u3002\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u90fd\u4f1a\u5305\u542b\u5728<a class=\"link\" href=\"/docs/devel/logical-replication.html\" title=\"\u7b2c\u00a029\u00a0\u7ae0\u00a0\u903b\u8f91\u590d\u5236\">\u903b\u8f91\u590d\u5236</a>\u914d\u7f6e\u4e2d\u3002\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u4f1a\u521b\u5efa\u4e00\u5bf9\u53d1\u5e03\u548c\u8ba2\u9605\u5bf9\u8c61\u3002\u8be5\u5de5\u5177\u5fc5\u987b\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002</p>\n<p lang=\"zh\">\u6210\u529f\u8fd0\u884c\u540e\uff0c\u76ee\u6807\u670d\u52a1\u5668\u7684\u72b6\u6001\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u65b0\u7684\u903b\u8f91\u590d\u5236\u914d\u7f6e\u3002\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e0e<span class=\"application\">pg_createsubscriber</span>\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u6570\u636e\u540c\u6b65\u7684\u5b8c\u6210\u65b9\u5f0f\u3002<span class=\"application\">pg_createsubscriber</span> \u4e0d\u4f1a\u590d\u5236\u521d\u59cb\u8868\u6570\u636e\u3002\u5b83\u53ea\u6267\u884c\u540c\u6b65\u9636\u6bb5\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u8868\u90fd\u8fbe\u5230\u540c\u6b65\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4e3b\u8981\u9762\u5411\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e2d\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u590d\u5236\u521d\u59cb\u6570\u636e\u4e0a\u3002\u6b64\u5916\uff0c\u5728\u6570\u636e\u540c\u6b65\u4e0a\u82b1\u8d39\u8f83\u957f\u65f6\u95f4\u7684\u4e00\u4e2a\u526f\u4f5c\u7528\u901a\u5e38\u662f\uff0c\u4f1a\u6709\u5927\u91cf\u5728\u521d\u59cb\u6570\u636e\u590d\u5236\u671f\u95f4\u4ea7\u751f\u7684\u66f4\u6539\u9700\u8981\u5e94\u7528\uff0c\u8fd9\u4f1a\u8fdb\u4e00\u6b65\u5ef6\u540e\u903b\u8f91\u526f\u672c\u53ef\u7528\u7684\u65f6\u95f4\u3002\u5bf9\u4e8e\u8f83\u5c0f\u7684\u6570\u636e\u5e93\uff0c\u5efa\u8bae\u5efa\u7acb\u5e26\u521d\u59cb\u6570\u636e\u540c\u6b65\u7684\u903b\u8f91\u590d\u5236\u3002\u8be6\u89c1<code class=\"command\">CREATE SUBSCRIPTION</code>\u7684 <a class=\"link\" href=\"/docs/devel/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-COPY-DATA\"><code class=\"literal\">copy_data</code></a>\u9009\u9879\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.6\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u4e86\u83b7\u53d6\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528<code class=\"option\">--publisher-server</code> \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">postgres</code>\u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">template1</code>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">--database</code>\u3001<code class=\"option\">--publication</code>\u3001<code class=\"option\">--replication-slot</code>\u6216<code class=\"option\">--subscription</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">-d</code> \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-a</code>\u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b<code class=\"option\">-d</code>\u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728<code class=\"option\">-d</code>\u9009\u9879\u6216<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a<code class=\"option\">-a</code>\u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>directory</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--logdir=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u65e5\u5fd7\u76ee\u5f55\u7684\u540d\u79f0\u3002\u5982\u679c\u8be5\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u76ee\u5f55\u3002\u8fd8\u4f1a\u521b\u5efa\u4e00\u4e2a\u5e26\u65f6\u95f4\u6233\u7684\u5b50\u76ee\u5f55\uff0c\u7528\u4e8e\u6807\u8bc6\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span> \u7684\u65f6\u95f4\u3002\u8be5\u5b50\u76ee\u5f55\u4e2d\u4f1a\u521b\u5efa\u4ee5\u4e0b\u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"filename\">pg_createsubscriber_server.log</code>\uff1a\u8bb0\u5f55\u4e0e\u505c\u6b62\u548c\u542f\u52a8\u5907\u5e93\u76f8\u5173\u7684\u65e5\u5fd7\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"filename\">pg_createsubscriber_internal.log</code>\uff1a\u8bb0\u5f55\u5185\u90e8\u8bca\u65ad\u8f93\u51fa\uff08\u6821\u9a8c\u3001\u68c0\u67e5\u7b49\uff09\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"systemitem\">umask</span> \u8bbe\u4e3a 077\uff0c\u56e0\u6b64\u65e5\u5fd7\u6587\u4ef6\u53ea\u6709\u8fd0\u884c\u8be5\u547d\u4ee4\u7684\u7528\u6237\u53ef\u8bfb\u3002\u4e0d\u8fc7\uff0c\u5982\u679c\u76ee\u6807\u6570\u636e\u76ee\u5f55\u914d\u7f6e\u4e3a\u5141\u8bb8\u7ec4\u8bfb\u8bbf\u95ee\uff0c<span class=\"application\">pg_createsubscriber</span> \u4f1a\u8c03\u6574\u65e5\u5fd7\u6587\u4ef6\u6743\u9650\u4ee5\u5339\u914d\u3002\u8fd9\u786e\u4fdd\u65e5\u5fd7\u6587\u4ef6\u7684\u5b89\u5168\u6027\u4e0e\u6570\u636e\u5e93\u96c6\u7c07\u672c\u8eab\u4fdd\u6301\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code><br/></span><span class=\"term\"><code class=\"option\">--dry-run</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>connstr</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--publisher-server=<em class=\"replaceable\"><code>connstr</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1<a class=\"xref\" href=\"/docs/devel/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u7b2c\u00a032.1.1\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>dir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--socketdir=<em class=\"replaceable\"><code>dir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--recovery-timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code><br/></span><span class=\"term\"><code class=\"option\">--enable-two-phase</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u8ba2\u9605\u542f\u7528 <a class=\"link\" href=\"/docs/devel/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">false</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f <span class=\"application\">pg_createsubscriber</span>\u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--clean=<em class=\"replaceable\"><code>objtype</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<ul class=\"itemizedlist\" style=\"list-style-type: disc;\">\n<li class=\"listitem\">\n<p><code class=\"literal\">publications</code>\uff1a\u4e3a\u8be5\u8ba2\u9605\u8005\u5efa\u7acb\u7684<code class=\"literal\">FOR ALL TABLES</code>\u53d1\u5e03\u603b\u662f\u4f1a\u88ab\u5220\u9664\uff1b\u6307\u5b9a\u6b64\u5bf9\u8c61\u7c7b\u578b\u8fd8\u4f1a\u5220\u9664\u4ece\u6e90\u670d\u52a1\u5668\u590d\u5236\u8fc7\u6765\u7684\u5176\u4ed6\u6240\u6709\u53d1\u5e03\u3002</p>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u88ab\u9009\u4e2d\u8981\u5220\u9664\u7684\u5bf9\u8c61\u90fd\u4f1a\u9010\u4e2a\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\uff0c\u5305\u62ec\u5728<code class=\"option\">--dry-run</code> \u671f\u95f4\u4e5f\u662f\u5982\u6b64\u3002\u6ca1\u6709\u673a\u4f1a\u5e72\u9884\u6216\u505c\u6b62\u8fd9\u4e9b\u5bf9\u8c61\u7684\u5220\u9664\uff0c\u56e0\u6b64\u53ef\u4ee5\u8003\u8651\u4f7f\u7528 <span class=\"application\">pg_dump</span>\u5148\u5bf9\u5b83\u4eec\u8fdb\u884c\u5907\u4efd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--config-file=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<span class=\"application\">pg_createsubscriber</span>\u5728\u5185\u90e8\u4f7f\u7528 <span class=\"application\">pg_ctl</span>\u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684<code class=\"filename\">postgresql.conf</code>\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--publication=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--publication</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u53d1\u5e03\u5df2\u7ecf\u5b58\u5728\u4e8e\u53d1\u5e03\u8005\u4e0a\uff0c\u5219\u4f1a\u590d\u7528\u5b83\u3002\u5982\u679c\u6307\u5b9a\u7684\u53d1\u5e03\u5305\u542b\u4e00\u4e2a\u8868\u5217\u8868\uff0c\u90a3\u4e48\u8fd9\u5bf9\u90e8\u5206\u590d\u5236\u6570\u636e\u5e93\u5f88\u6709\u7528\u3002\u5982\u679c\u8be5\u53d1\u5e03\u4e0d\u5b58\u5728\uff0c\u5219\u4f1a\u81ea\u52a8\u4ee5 <code class=\"literal\">FOR ALL TABLES</code> \u521b\u5efa\u5b83\u3002\u4f7f\u7528<code class=\"option\">--dry-run</code> \u9009\u9879\u53ef\u4ee5\u9884\u89c8\u54ea\u4e9b\u53d1\u5e03\u4f1a\u88ab\u590d\u7528\u3001\u54ea\u4e9b\u4f1a\u88ab\u521b\u5efa\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--replication-slot=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--replication-slot</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--subscription=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--subscription</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_createsubscriber</span>\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a<span class=\"application\">pg_createsubscriber</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.2\">\n<h3 lang=\"zh\">\u524d\u7f6e\u6761\u4ef6</h3>\n<p lang=\"zh\">\u8981\u8ba9<span class=\"application\">pg_createsubscriber</span>\u5c06\u76ee\u6807\u670d\u52a1\u5668\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u9700\u8981\u6ee1\u8db3\u4e00\u4e9b\u524d\u63d0\u6761\u4ef6\u3002\u5982\u679c\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u5c31\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u6e90\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7684\u4e3b\u7248\u672c\u5fc5\u987b\u4e0e <span class=\"application\">pg_createsubscriber</span>\u76f8\u540c\u3002\u7ed9\u5b9a\u7684\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5fc5\u987b\u4e0e\u6e90\u6570\u636e\u76ee\u5f55\u5177\u6709\u76f8\u540c\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u6307\u5b9a\u7684\u6570\u636e\u5e93\u7528\u6237\u5fc5\u987b\u5177\u5907\u521b\u5efa<a class=\"link\" href=\"/docs/devel/sql-createsubscription.html\" title=\"CREATE SUBSCRIPTION\">\u8ba2\u9605</a>\u4ee5\u53ca\u4f7f\u7528<a class=\"link\" href=\"/docs/devel/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u7684\u6743\u9650\u3002</p>\n<p lang=\"zh\">\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u4f5c\u4e3a\u7269\u7406\u5907\u5e93\u4f7f\u7528\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-MAX-ACTIVE-REPLICATION-ORIGINS\">max_active_replication_origins</a>\u548c<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS\">max_logical_replication_workers</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u5982\u679c\u8ba1\u5212\u4f7f\u7528<code class=\"option\">--enable-two-phase</code> \u5f00\u5173\uff0c\u8fd8\u9700\u8981\u9002\u5f53\u5730\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/devel/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS\">max_prepared_transactions</a>\u3002</p>\n<p lang=\"zh\">\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u6765\u81ea\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u6e90\u670d\u52a1\u5668\u4e0d\u80fd\u5904\u4e8e\u6062\u590d\u4e2d\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-wal.html#GUC-WAL-LEVEL\">wal_level</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">replica</code>\u6216 <code class=\"literal\">logical</code>\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u52a0\u73b0\u6709\u590d\u5236\u69fd\u6570\u91cf\u7684\u503c\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\">max_wal_senders</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u4e0e\u73b0\u6709 WAL \u53d1\u9001\u8fdb\u7a0b\u6570\u91cf\u4e4b\u548c\u7684\u503c\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.3\">\n<h3 lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5728\u76ee\u6807\u670d\u52a1\u5668\u88ab\u63d0\u5347\u540e\u5931\u8d25\uff0c\u6570\u636e\u76ee\u5f55\u5f88\u53ef\u80fd\u5df2\u5904\u4e8e\u4e0d\u53ef\u6062\u590d\u72b6\u6001\u3002\u6b64\u65f6\u5efa\u8bae\u91cd\u65b0\u521b\u5efa\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c<span class=\"application\">pg_createsubscriber</span>\u901a\u5e38\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u8fde\u63a5\u8bbe\u7f6e\u6765\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5e94\u8be5\u4f1a\u5931\u8d25\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e\u903b\u8f91\u590d\u5236\u4e0d\u590d\u5236 DDL \u547d\u4ee4\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\u5e94\u907f\u514d\u6267\u884c\u4f1a\u66f4\u6539\u6570\u636e\u5e93\u6a21\u5f0f\u7684 DDL \u547d\u4ee4\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u76f8\u5173 DDL \u53ef\u80fd\u4e0d\u4f1a\u88ab\u590d\u5236\uff0c\u4ece\u800c\u5f15\u53d1\u9519\u8bef\u3002</p>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5904\u7406\u8fc7\u7a0b\u4e2d\u5931\u8d25\uff0c\u4f1a\u5220\u9664\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u5bf9\u8c61\uff08\u53d1\u5e03\u3001\u590d\u5236\u69fd\uff09\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5220\u9664\u53ef\u80fd\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8b66\u544a\u6d88\u606f\u4f1a\u63d0\u793a\u9057\u7559\u7684\u5bf9\u8c61\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u5b83\u4f1a\u88ab\u505c\u6b62\u3002</p>\n<p lang=\"zh\">\u82e5\u590d\u5236\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u5b8c\u6210\u540e\u4f1a\u4ece\u6e90\u670d\u52a1\u5668\u79fb\u9664\u8be5\u590d\u5236\u69fd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u662f\u540c\u6b65\u526f\u672c\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\uff0c\u4e3b\u5e93\u4e0a\u7684\u4e8b\u52a1\u63d0\u4ea4\u53ef\u80fd\u4f1a\u5728\u7b49\u5f85\u590d\u5236\u65f6\u963b\u585e\u3002</p>\n<p lang=\"zh\">\u9664\u975e\u6307\u5b9a<code class=\"option\">--enable-two-phase</code>\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u5728\u7981\u7528\u4e24\u9636\u6bb5\u63d0\u4ea4\u7684\u60c5\u51b5\u4e0b\u5efa\u7acb\u903b\u8f91\u590d\u5236\u3002\u8fd9\u610f\u5473\u7740\u4efb\u4f55\u9884\u5907\u4e8b\u52a1\u90fd\u4f1a\u5728<code class=\"command\">COMMIT PREPARED</code>\u65f6\u88ab\u590d\u5236\uff0c\u800c\u4e0d\u4f1a\u4e8b\u5148\u8fdb\u884c\u9884\u5907\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u8ba2\u9605\uff0c\u5e76\u542f\u7528<a class=\"link\" href=\"/docs/devel/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u4f7f\u7528<span class=\"application\">pg_resetwal</span> \u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u76ee\u6807\u670d\u52a1\u5668\u53ef\u80fd\u4f7f\u7528\u6e90\u670d\u52a1\u5668\u7684 WAL \u6587\u4ef6\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u6709\u5907\u5e93\uff0c\u590d\u5236\u5c06\u4f1a\u4e2d\u65ad\uff0c\u5e94\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u82e5\u7f3a\u5c11\u5fc5\u9700 WAL \u6587\u4ef6\uff0c\u590d\u5236\u53ef\u80fd\u5931\u8d25\u3002\u4e3a\u907f\u514d\u8be5\u95ee\u9898\uff0c\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE\">max_slot_wal_keep_size</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">-1</code>\uff0c\u4ee5\u786e\u4fdd\u5fc5\u9700 WAL \u6587\u4ef6\u4e0d\u4f1a\u88ab\u63d0\u524d\u79fb\u9664\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.4\">\n<h3 lang=\"zh\">\u5de5\u4f5c\u539f\u7406</h3>\n<p lang=\"zh\">\u57fa\u672c\u601d\u8def\u662f\u4ece\u6e90\u670d\u52a1\u5668\u83b7\u5f97\u590d\u5236\u8d77\u70b9\uff0c\u5e76\u4ece\u8be5\u4f4d\u7f6e\u5f00\u59cb\u5efa\u7acb\u903b\u8f91\u590d\u5236\uff1a</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" lang=\"zh\">\n<p>\u4f7f\u7528\u6307\u5b9a\u547d\u4ee4\u884c\u9009\u9879\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u5728\u8fd0\u884c\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u68c0\u67e5\u76ee\u6807\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8f6c\u6362\uff0c\u540c\u65f6\u4e5f\u4f1a\u5bf9\u6e90\u670d\u52a1\u5668\u8fdb\u884c\u4e00\u4e9b\u68c0\u67e5\u3002\u82e5\u4efb\u4e00\u524d\u7f6e\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u521b\u5efa\u4e00\u4e2a\u53d1\u5e03\u548c\u4e00\u4e2a\u590d\u5236\u69fd\u3002\u6bcf\u4e2a\u53d1\u5e03\u90fd\u4ee5<a class=\"link\" href=\"/docs/devel/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"><code class=\"literal\">FOR ALL TABLES</code></a>\u521b\u5efa\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--publication</code>\uff0c\u53d1\u5e03\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--replication-slot</code>\uff0c\u590d\u5236\u69fd\u7684\u540d\u79f0\u6a21\u5f0f\u5982\u4e0b\uff1a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8fd9\u4e9b\u590d\u5236\u69fd\u5c06\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u88ab\u8ba2\u9605\u4f7f\u7528\u3002\u6700\u540e\u4e00\u4e2a\u590d\u5236\u69fd\u7684 LSN \u4f1a\u5728<a class=\"xref\" href=\"/docs/devel/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\u53c2\u6570\u4e2d\u7528\u4f5c\u505c\u6b62\u70b9\uff0c\u4e5f\u4f1a\u88ab\u8ba2\u9605\u7528\u4f5c\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6062\u590d\u53c2\u6570\u5199\u5165\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u72ec\u7acb\u914d\u7f6e\u6587\u4ef6 <code class=\"filename\">pg_createsubscriber.conf</code>\uff0c\u8be5\u6587\u4ef6\u901a\u8fc7\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4e2d\u7684 <code class=\"filename\">postgresql.auto.conf</code> \u91cc\u7684 <code class=\"literal\">include_if_exists</code> \u5f15\u5165\uff0c\u7136\u540e\u91cd\u542f\u76ee\u6807\u670d\u52a1\u5668\u3002\u5b83\u6307\u5b9a\u4e86\u6062\u590d\u5c06\u63a8\u8fdb\u5230\u7684\u9884\u5199\u5f0f\u65e5\u5fd7\u4f4d\u7f6e\u7684 LSN\uff08<a class=\"xref\" href=\"/docs/devel/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\uff09\u3002\u5b83\u8fd8\u5c06<code class=\"literal\">promote</code>\u6307\u5b9a\u4e3a\u670d\u52a1\u5668\u5728\u8fbe\u5230\u6062\u590d\u76ee\u6807\u540e\u5e94\u6267\u884c\u7684\u52a8\u4f5c\u3002\u8fd8\u4f1a\u6dfb\u52a0\u5176\u4ed6<a class=\"link\" href=\"/docs/devel/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET\" title=\"19.5.6.\u00a0\u6062\u590d\u76ee\u6807\">\u6062\u590d\u53c2\u6570</a>\uff0c\u4ee5\u907f\u514d\u6062\u590d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u610f\u5916\u884c\u4e3a\uff0c\u4f8b\u5982\u4e00\u8fbe\u5230\u4e00\u81f4\u72b6\u6001\u5c31\u7ed3\u675f\u6062\u590d\uff08WAL \u5e94\u7ee7\u7eed\u5e94\u7528\u5230\u590d\u5236\u8d77\u59cb\u4f4d\u7f6e\uff09\uff0c\u6216\u8005\u56e0\u6307\u5b9a\u591a\u4e2a\u6062\u590d\u76ee\u6807\u800c\u5931\u8d25\u3002\u5f53\u670d\u52a1\u5668\u9000\u51fa\u5907\u5e93\u6a21\u5f0f\u5e76\u63a5\u53d7\u8bfb\u5199\u4e8b\u52a1\u65f6\uff0c\u8be5\u6b65\u9aa4\u7ed3\u675f\u3002\u5982\u679c\u8bbe\u7f6e\u4e86<code class=\"option\">--recovery-timeout</code>\u9009\u9879\uff0c\u800c\u6062\u590d\u5728\u7ed9\u5b9a\u79d2\u6570\u5185\u6ca1\u6709\u7ed3\u675f\uff0c<span class=\"application\">pg_createsubscriber</span>\u5c31\u4f1a\u7ec8\u6b62\u3002\u5b8c\u6210\u540e\uff0c\u88ab\u5305\u542b\u7684\u914d\u7f6e\u6587\u4ef6\u4f1a\u91cd\u547d\u540d\u4e3a <code class=\"filename\">pg_createsubscriber.conf.disabled</code>\uff0c\u4f7f\u5176\u4e0d\u518d\u5728\u540e\u7eed\u91cd\u542f\u65f6\u52a0\u8f7d\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u521b\u5efa\u8ba2\u9605\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--subscription</code>\uff0c\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8be5\u8ba2\u9605\u4e0d\u4f1a\u590d\u5236\u6e90\u670d\u52a1\u5668\u4e0a\u7684\u73b0\u6709\u6570\u636e\uff0c\u4e5f\u4e0d\u4f1a\u521b\u5efa\u590d\u5236\u69fd\uff0c\u800c\u662f\u4f7f\u7528\u524d\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u590d\u5236\u69fd\u3002\u8ba2\u9605\u4f1a\u88ab\u521b\u5efa\uff0c\u4f46\u5c1a\u4e0d\u542f\u7528\uff0c\u56e0\u4e3a\u5fc5\u987b\u5728\u542f\u52a8\u590d\u5236\u4e4b\u524d\u5148\u5c06\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u5230\u590d\u5236\u8d77\u70b9\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5220\u9664\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u88ab\u590d\u5236\u8fc7\u6765\u7684\u53d1\u5e03\uff08\u8fd9\u4e9b\u53d1\u5e03\u662f\u5728\u590d\u5236\u8d77\u70b9\u524d\u521b\u5efa\u7684\uff09\uff0c\u5b83\u4eec\u5728\u8ba2\u9605\u8005\u4e0a\u6ca1\u6709\u7528\u9014\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6bcf\u4e2a\u8ba2\u9605\u7684\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u590d\u5236\u8d77\u70b9\u3002\u5f53\u76ee\u6807\u670d\u52a1\u5668\u5f00\u59cb\u6062\u590d\u8fc7\u7a0b\u65f6\uff0c\u5b83\u4f1a\u8ffd\u8d76\u5230\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6b63\u662f\u6bcf\u4e2a\u8ba2\u9605\u8981\u7528\u4f5c\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u7684 LSN\u3002\u7531\u4e8e\u8ba2\u9605\u5df2\u7ecf\u521b\u5efa\uff0c\u56e0\u6b64\u53ef\u4ee5\u53d6\u5f97\u590d\u5236\u6e90\u540d\u79f0\u3002\u4f7f\u7528\u590d\u5236\u6e90\u540d\u79f0\u548c\u590d\u5236\u8d77\u70b9\u8c03\u7528 <a class=\"link\" href=\"/docs/devel/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u4ee5\u8bbe\u7f6e\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u7684\u8ba2\u9605\u3002\u8ba2\u9605\u5c06\u4ece\u590d\u5236\u8d77\u70b9\u5f00\u59cb\u5e94\u7528\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/devel/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u8be5\u590d\u5236\u69fd\u4e4b\u540e\u4e0d\u518d\u6709\u7528\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u5305\u542b<a class=\"link\" href=\"/docs/devel/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS-SYNCHRONIZATION\" title=\"47.2.3.\u00a0\u590d\u5236\u69fd\u540c\u6b65\">\u6545\u969c\u5207\u6362\u590d\u5236\u69fd</a>\uff0c\u5b83\u4eec\u540e\u7eed\u65e0\u6cd5\u7ee7\u7eed\u540c\u6b65\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u66f4\u65b0\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4f1a\u8fd0\u884c<a class=\"xref\" href=\"/docs/devel/app-pgresetwal.html\" title=\"pg_resetwal\"><span class=\"refentrytitle\"><span class=\"application\">pg_resetwal</span></span></a>\u6765\u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u7531\u4e8e<code class=\"command\">pg_resetwal</code>\u7684\u8981\u6c42\uff0c\u76ee\u6807\u670d\u52a1\u5668\u4f1a\u88ab\u505c\u6b62\u3002</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u4ece foo \u4e0a\u7684\u7269\u7406\u526f\u672c\u4e3a hr \u548c finance \u6570\u636e\u5e93\u521b\u5efa\u903b\u8f91\u526f\u672c\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_createsubscriber -D /usr/local/pgsql/data -P \"host=foo\" -d hr -d finance</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.9\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/devel/app-pgbasebackup.html\" title=\"pg_basebackup\"><span class=\"refentrytitle\"><span class=\"application\">pg_basebackup</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgcreatesubscriber.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/app-pgcreatesubscriber.html", "method": "same-major semantic node", "sha256": "ea6a31f236a94592cc2323aaec6ca4ed04b5d66d159b5e142bb0ad373bc793ad", "language": "zh", "matched_nodes": ["#APP-PGCREATESUBSCRIBER/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[3]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[4]/p[1]", "#APP-PGCREATESUBSCRIBER/div[4]/p[2]", "#APP-PGCREATESUBSCRIBER/div[4]/p[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[11]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[19]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[21]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/div[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]/p[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[35]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[37]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/div[1]/ul[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/div[1]/ul[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[9]", "#APP-PGCREATESUBSCRIBER/div[5]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[10]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[7]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[8]/h2[0]"]}], "language": "zh", "original_text": {"/summary": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/category": "Server applications", "/versions/20/description/0": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/versions/20/facts/0/label": "Documented executable", "/versions/20/facts/1/label": "Executable version", "/versions/20/facts/2/label": "Reference inventory", "/versions/20/facts/2/value": "Server applications", "/versions/20/facts/3/label": "Option definition groups", "/versions/20/tables/0/title": "Documented options", "/versions/20/tables/0/rows/0/summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "/versions/20/tables/0/rows/1/summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "/versions/20/tables/0/rows/2/summary": "The target directory that contains a cluster directory from a physical replica.", "/versions/20/tables/0/rows/3/summary": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory.", "/versions/20/tables/0/rows/4/summary": "Do everything except actually modifying the target directory.", "/versions/20/tables/0/rows/5/summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "/versions/20/tables/0/rows/6/summary": "The connection string to the publisher. For details see Section 32.1.1 .", "/versions/20/tables/0/rows/7/summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "/versions/20/tables/0/rows/8/summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "/versions/20/tables/0/rows/9/summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "/versions/20/tables/0/columns/0/label": "Option and arguments", "/versions/20/tables/0/columns/1/label": "Description", "/versions/20/tables/0/rows/10/summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "/versions/20/tables/0/rows/11/summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/20/tables/0/rows/12/summary": "Drop all objects of the specified type from specified databases on the target server.", "/versions/20/tables/0/rows/13/summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "/versions/20/tables/0/rows/14/summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "/versions/20/tables/0/rows/15/summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "/versions/20/tables/0/rows/16/summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "/versions/20/tables/0/rows/17/summary": "Print the pg_createsubscriber version and exit.", "/versions/20/tables/0/rows/18/summary": "Show help about pg_createsubscriber command line arguments, and exit."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ebee1054f5c96d4ae9a877a2f3924bd4c6b4e02d25fe0956e6b42aa1a9a0c8de"}, "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "signature": "-d dbname --database= dbname", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-l directory", "--logdir= directory"], "signature": "-l directory --logdir= directory", "description": "Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory. pg_createsubscriber_server.log which captures logs related to stopping and starting the standby server, pg_createsubscriber_internal.log which captures internal diagnostic output (validations, checks, etc.) By default, the umask is set to 077 so that the log files are only readable by the user running the command. However, if the target data directory is configured to allow group-read access, pg_createsubscriber will adjust the log file permissions to match. This ensures that the log file security remains consistent with the database cluster itself."}, {"names": ["-n", "--dry-run"], "signature": "-n --dry-run", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "signature": "-p port --subscriber-port= port", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "signature": "-P connstr --publisher-server= connstr", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "signature": "-s dir --socketdir= dir", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "signature": "-t seconds --recovery-timeout= seconds", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "signature": "-T --enable-two-phase", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "signature": "-U username --subscriber-username= username", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "signature": "--clean= objtype", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "signature": "--config-file= filename", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "signature": "--publication= name", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all . If a specified publication already exists on the publisher, it is reused. It is useful to partially replicate the database if the specified publication includes a list of tables. If the publication does not exist, it is automatically created with FOR ALL TABLES . Use --dry-run option to preview which publications will be reused and which will be created."}, {"names": ["--replication-slot= name"], "signature": "--replication-slot= name", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "signature": "--subscription= name", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "environment": []}, "comparison_hash": "b4807e2c2ddbf51e9e6cdd5c6c5a1cd58c95530174f72f8e053b38ce95c721d8", "manual_language": "zh"}}}, "snapshot": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_createsubscriber"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528 --publisher-server \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 postgres \u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 template1 \u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --database \u3001 --publication \u3001 --replication-slot \u6216 --subscription \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-a --all"}}, {"summary": "\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a -d \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e -a \u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b -d \u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece -P \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728 -d \u9009\u9879\u6216 -P \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a -a \u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-d dbname --database= dbname"}}, {"summary": "\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-D directory --pgdata= directory"}}, {"summary": "\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-n --dry-run"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-p port --subscriber-port= port"}}, {"summary": "\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1 \u7b2c 32.1.1 \u8282 \u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-P connstr --publisher-server= connstr"}}, {"summary": "\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-s dir --socketdir= dir"}}, {"summary": "\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-t seconds --recovery-timeout= seconds"}}, {"summary": "\u4e3a\u8ba2\u9605\u542f\u7528 two_phase \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a false \u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-T --enable-two-phase"}}, {"summary": "\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-U username --subscriber-username= username"}}, {"summary": "\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f pg_createsubscriber \u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-v --verbose"}}, {"summary": "\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--clean= objtype"}}, {"summary": "\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002 pg_createsubscriber \u5728\u5185\u90e8\u4f7f\u7528 pg_ctl \u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684 postgresql.conf \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--config-file= filename"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --publication \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--publication= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --replication-slot \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--replication-slot= name"}}, {"summary": "\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a --subscription \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e --all \u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "--subscription= name"}}, {"summary": "\u6253\u5370 pg_createsubscriber \u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-V --version"}}, {"summary": "\u663e\u793a pg_createsubscriber \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgcreatesubscriber.html", "text": "-? --help"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}], "options": [{"names": ["-a", "--all"], "summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "signature": "-a --all", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "signature": "-d dbname --database= dbname", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D directory", "--pgdata= directory"], "summary": "The target directory that contains a cluster directory from a physical replica.", "signature": "-D directory --pgdata= directory", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "summary": "Do everything except actually modifying the target directory.", "signature": "-n --dry-run", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "signature": "-p port --subscriber-port= port", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "summary": "The connection string to the publisher. For details see Section 32.1.1 .", "signature": "-P connstr --publisher-server= connstr", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "signature": "-s dir --socketdir= dir", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "signature": "-t seconds --recovery-timeout= seconds", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "signature": "-T --enable-two-phase", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "signature": "-U username --subscriber-username= username", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "summary": "Drop all objects of the specified type from specified databases on the target server.", "signature": "--clean= objtype", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "signature": "--config-file= filename", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "signature": "--publication= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all ."}, {"names": ["--replication-slot= name"], "summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "signature": "--replication-slot= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "signature": "--subscription= name", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "summary": "Print the pg_createsubscriber version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "summary": "Show help about pg_createsubscriber command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgcreatesubscriber.html", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/app-pgcreatesubscriber.html", "file": "app-pgcreatesubscriber.html", "label": "18.6 English manual \u00b7 app-pgcreatesubscriber.html", "anchor": "", "sha256": "fb0e5cd7f37044410e06deb436d7b70a1bceffbd849ce10f468351d9cf11d385", "language": "en", "original_url": "/docs/18/app-pgcreatesubscriber.html"}, {"url": "https://pg.center/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3", "language": "en", "original_url": "/docs/18/reference-server.html"}], "sections": [], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "signature": "pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr", "description": ["pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGCREATESUBSCRIBER\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_createsubscriber</span></span></h2>\n<p lang=\"zh\">pg_createsubscriber \u2014 \u5c06\u7269\u7406\u526f\u672c\u8f6c\u6362\u4e3a\u65b0\u7684\u903b\u8f91\u526f\u672c</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.1\"><code class=\"command\">pg_createsubscriber</code> [<em class=\"replaceable\"><code>option</code></em>...] { <code class=\"option\">-d</code> | <code class=\"option\">--database</code> }<em class=\"replaceable\"><code>dbname</code></em> { <code class=\"option\">-D</code> | <code class=\"option\">--pgdata</code> }<em class=\"replaceable\"><code>datadir</code></em> { <code class=\"option\">-P</code> | <code class=\"option\">--publisher-server</code> }<em class=\"replaceable\"><code>connstr</code></em></p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4ece\u7269\u7406\u5907\u5e93\u521b\u5efa\u65b0\u7684\u903b\u8f91\u526f\u672c\u3002\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u90fd\u4f1a\u5305\u542b\u5728<a class=\"link\" href=\"/docs/18/logical-replication.html\" title=\"\u7b2c\u00a029\u00a0\u7ae0\u00a0\u903b\u8f91\u590d\u5236\">\u903b\u8f91\u590d\u5236</a>\u914d\u7f6e\u4e2d\u3002\u6bcf\u4e2a\u6570\u636e\u5e93\u90fd\u4f1a\u521b\u5efa\u4e00\u5bf9\u53d1\u5e03\u548c\u8ba2\u9605\u5bf9\u8c61\u3002\u8be5\u5de5\u5177\u5fc5\u987b\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002</p>\n<p lang=\"zh\">\u6210\u529f\u8fd0\u884c\u540e\uff0c\u76ee\u6807\u670d\u52a1\u5668\u7684\u72b6\u6001\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u65b0\u7684\u903b\u8f91\u590d\u5236\u914d\u7f6e\u3002\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e0e<span class=\"application\">pg_createsubscriber</span>\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u6570\u636e\u540c\u6b65\u7684\u5b8c\u6210\u65b9\u5f0f\u3002<span class=\"application\">pg_createsubscriber</span> \u4e0d\u4f1a\u590d\u5236\u521d\u59cb\u8868\u6570\u636e\u3002\u5b83\u53ea\u6267\u884c\u540c\u6b65\u9636\u6bb5\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u8868\u90fd\u8fbe\u5230\u540c\u6b65\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4e3b\u8981\u9762\u5411\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u4e2d\uff0c\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u82b1\u5728\u590d\u5236\u521d\u59cb\u6570\u636e\u4e0a\u3002\u6b64\u5916\uff0c\u5728\u6570\u636e\u540c\u6b65\u4e0a\u82b1\u8d39\u8f83\u957f\u65f6\u95f4\u7684\u4e00\u4e2a\u526f\u4f5c\u7528\u901a\u5e38\u662f\uff0c\u4f1a\u6709\u5927\u91cf\u5728\u521d\u59cb\u6570\u636e\u590d\u5236\u671f\u95f4\u4ea7\u751f\u7684\u66f4\u6539\u9700\u8981\u5e94\u7528\uff0c\u8fd9\u4f1a\u8fdb\u4e00\u6b65\u5ef6\u540e\u903b\u8f91\u526f\u672c\u53ef\u7528\u7684\u65f6\u95f4\u3002\u5bf9\u4e8e\u8f83\u5c0f\u7684\u6570\u636e\u5e93\uff0c\u5efa\u8bae\u5efa\u7acb\u5e26\u521d\u59cb\u6570\u636e\u540c\u6b65\u7684\u903b\u8f91\u590d\u5236\u3002\u8be6\u89c1<code class=\"command\">CREATE SUBSCRIPTION</code>\u7684 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-COPY-DATA\"><code class=\"literal\">copy_data</code></a>\u9009\u9879\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.6\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8ba2\u9605\u3002\u6a21\u677f\u6570\u636e\u5e93\u4ee5\u53ca\u4e0d\u5141\u8bb8\u8fde\u63a5\u7684\u6570\u636e\u5e93\u9664\u5916\u3002\u4e3a\u53d1\u73b0\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\uff0c\u5de5\u5177\u4f1a\u4f7f\u7528<code class=\"option\">--publisher-server</code> \u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u7684\u6570\u636e\u5e93\u540d\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff1b\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">postgres</code>\u6570\u636e\u5e93\uff1b\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528 <code class=\"literal\">template1</code>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u4f1a\u4f7f\u7528\u81ea\u52a8\u751f\u6210\u7684\u8ba2\u9605\u3001\u53d1\u5e03\u548c\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">--database</code>\u3001<code class=\"option\">--publication</code>\u3001<code class=\"option\">--replication-slot</code>\u6216<code class=\"option\">--subscription</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u5728\u5176\u4e2d\u521b\u5efa\u8ba2\u9605\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">-d</code> \u53ef\u4ee5\u9009\u62e9\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-a</code>\u4e00\u8d77\u4f7f\u7528\u3002\u5982\u679c\u672a\u63d0\u4f9b<code class=\"option\">-d</code>\u9009\u9879\uff0c\u6570\u636e\u5e93\u540d\u5c06\u4ece<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u83b7\u53d6\u3002\u5982\u679c\u5728<code class=\"option\">-d</code>\u9009\u9879\u6216<code class=\"option\">-P</code> \u9009\u9879\u4e2d\u90fd\u672a\u6307\u5b9a\u6570\u636e\u5e93\u540d\uff0c\u4e14\u53c8\u672a\u6307\u5b9a<code class=\"option\">-a</code>\u9009\u9879\uff0c\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>directory</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5305\u542b\u7269\u7406\u526f\u672c\u4e2d\u7684\u96c6\u7c07\u76ee\u5f55\u7684\u76ee\u6807\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code><br/></span><span class=\"term\"><code class=\"option\">--dry-run</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6267\u884c\u9664\u5b9e\u9645\u4fee\u6539\u76ee\u6807\u76ee\u5f55\u4e4b\u5916\u7684\u6240\u6709\u6b65\u9aa4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u76d1\u542c\u8fde\u63a5\u7684\u7aef\u53e3\u53f7\u3002\u9ed8\u8ba4\u4e3a\u8ba9\u76ee\u6807\u670d\u52a1\u5668\u5728 50432 \u7aef\u53e3\u4e0a\u8fd0\u884c\uff0c\u4ee5\u907f\u514d\u610f\u5916\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>connstr</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--publisher-server=<em class=\"replaceable\"><code>connstr</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5230\u53d1\u5e03\u8005\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u8be6\u60c5\u89c1<a class=\"xref\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u7b2c\u00a032.1.1\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>dir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--socketdir=<em class=\"replaceable\"><code>dir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u76ee\u6807\u670d\u52a1\u5668\u4e0a postmaster \u5957\u63a5\u5b57\u6240\u4f7f\u7528\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u4e3a\u5f53\u524d\u76ee\u5f55\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--recovery-timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u6062\u590d\u7ed3\u675f\u7684\u6700\u957f\u65f6\u95f4\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u8bbe\u4e3a 0 \u8868\u793a\u7981\u7528\u8be5\u9650\u5236\u3002\u9ed8\u8ba4\u503c\u4e3a 0\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code><br/></span><span class=\"term\"><code class=\"option\">--enable-two-phase</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u8ba2\u9605\u542f\u7528 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002\u5f53\u6307\u5b9a\u591a\u4e2a\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u4f1a\u7edf\u4e00\u5e94\u7528\u4e8e\u5728\u8fd9\u4e9b\u6570\u636e\u5e93\u4e0a\u521b\u5efa\u7684\u6240\u6709\u8ba2\u9605\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">false</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--subscriber-username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fde\u63a5\u76ee\u6807\u670d\u52a1\u5668\u6240\u4f7f\u7528\u7684\u7528\u6237\u540d\u3002\u9ed8\u8ba4\u662f\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u542f\u7528\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u5c06\u4f7f <span class=\"application\">pg_createsubscriber</span>\u5411\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u8fdb\u5ea6\u6d88\u606f\u4ee5\u53ca\u6bcf\u4e2a\u6b65\u9aa4\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u91cd\u590d\u6307\u5b9a\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--clean=<em class=\"replaceable\"><code>objtype</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ece\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u6307\u5b9a\u6570\u636e\u5e93\u4e2d\u5220\u9664\u6307\u5b9a\u7c7b\u578b\u7684\u6240\u6709\u5bf9\u8c61\u3002</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<ul class=\"itemizedlist\" style=\"list-style-type: disc;\">\n<li class=\"listitem\">\n<p><code class=\"literal\">publications</code>\uff1a\u4e3a\u8be5\u8ba2\u9605\u8005\u5efa\u7acb\u7684<code class=\"literal\">FOR ALL TABLES</code>\u53d1\u5e03\u603b\u662f\u4f1a\u88ab\u5220\u9664\uff1b\u6307\u5b9a\u6b64\u5bf9\u8c61\u7c7b\u578b\u8fd8\u4f1a\u5220\u9664\u4ece\u6e90\u670d\u52a1\u5668\u590d\u5236\u8fc7\u6765\u7684\u5176\u4ed6\u6240\u6709\u53d1\u5e03\u3002</p>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u88ab\u9009\u4e2d\u8981\u5220\u9664\u7684\u5bf9\u8c61\u90fd\u4f1a\u9010\u4e2a\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\uff0c\u5305\u62ec\u5728<code class=\"option\">--dry-run</code> \u671f\u95f4\u4e5f\u662f\u5982\u6b64\u3002\u6ca1\u6709\u673a\u4f1a\u5e72\u9884\u6216\u505c\u6b62\u8fd9\u4e9b\u5bf9\u8c61\u7684\u5220\u9664\uff0c\u56e0\u6b64\u53ef\u4ee5\u8003\u8651\u4f7f\u7528 <span class=\"application\">pg_dump</span>\u5148\u5bf9\u5b83\u4eec\u8fdb\u884c\u5907\u4efd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--config-file=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u4f7f\u7528\u6307\u5b9a\u7684\u4e3b\u914d\u7f6e\u6587\u4ef6\u3002<span class=\"application\">pg_createsubscriber</span>\u5728\u5185\u90e8\u4f7f\u7528 <span class=\"application\">pg_ctl</span>\u547d\u4ee4\u6765\u542f\u52a8\u548c\u505c\u6b62\u76ee\u6807\u670d\u52a1\u5668\u3002\u5982\u679c\u5b9e\u9645\u7684<code class=\"filename\">postgresql.conf</code>\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u5728\u6570\u636e\u76ee\u5f55\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u5141\u8bb8\u4f60\u663e\u5f0f\u6307\u5b9a\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--publication=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u53d1\u5e03\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--publication</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u53d1\u5e03\u3002\u53d1\u5e03\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u53d1\u5e03\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u53d1\u5e03\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--replication-slot=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u590d\u5236\u69fd\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--replication-slot</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u590d\u5236\u69fd\u3002\u590d\u5236\u69fd\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u590d\u5236\u69fd\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u8ba2\u9605\u540d\u79f0\u4f5c\u4e3a\u590d\u5236\u69fd\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--subscription=<em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u5efa\u7acb\u903b\u8f91\u590d\u5236\u7684\u8ba2\u9605\u540d\u79f0\u3002\u901a\u8fc7\u591a\u6b21\u6307\u5b9a<code class=\"option\">--subscription</code> \u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8ba2\u9605\u3002\u8ba2\u9605\u540d\u79f0\u7684\u6570\u91cf\u5fc5\u987b\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u5e93\u6570\u91cf\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u591a\u4e2a\u8ba2\u9605\u540d\u79f0\u5f00\u5173\u7684\u987a\u5e8f\u5fc5\u987b\u4e0e\u6570\u636e\u5e93\u5f00\u5173\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u672a\u6307\u5b9a\u6b64\u9009\u9879\uff0c\u5219\u4f1a\u4e3a\u8ba2\u9605\u5206\u914d\u4e00\u4e2a\u751f\u6210\u7684\u540d\u79f0\u3002\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--all</code>\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_createsubscriber</span>\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a<span class=\"application\">pg_createsubscriber</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.2\">\n<h3 lang=\"zh\">\u524d\u7f6e\u6761\u4ef6</h3>\n<p lang=\"zh\">\u8981\u8ba9<span class=\"application\">pg_createsubscriber</span>\u5c06\u76ee\u6807\u670d\u52a1\u5668\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u9700\u8981\u6ee1\u8db3\u4e00\u4e9b\u524d\u63d0\u6761\u4ef6\u3002\u5982\u679c\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u6761\u4ef6\uff0c\u5c31\u4f1a\u62a5\u544a\u9519\u8bef\u3002\u6e90\u670d\u52a1\u5668\u548c\u76ee\u6807\u670d\u52a1\u5668\u7684\u4e3b\u7248\u672c\u5fc5\u987b\u4e0e <span class=\"application\">pg_createsubscriber</span>\u76f8\u540c\u3002\u7ed9\u5b9a\u7684\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5fc5\u987b\u4e0e\u6e90\u6570\u636e\u76ee\u5f55\u5177\u6709\u76f8\u540c\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4e3a\u76ee\u6807\u6570\u636e\u76ee\u5f55\u6307\u5b9a\u7684\u6570\u636e\u5e93\u7528\u6237\u5fc5\u987b\u5177\u5907\u521b\u5efa<a class=\"link\" href=\"/docs/18/sql-createsubscription.html\" title=\"CREATE SUBSCRIPTION\">\u8ba2\u9605</a>\u4ee5\u53ca\u4f7f\u7528<a class=\"link\" href=\"/docs/18/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u7684\u6743\u9650\u3002</p>\n<p lang=\"zh\">\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u4f5c\u4e3a\u7269\u7406\u5907\u5e93\u4f7f\u7528\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-ACTIVE-REPLICATION-ORIGINS\">max_active_replication_origins</a>\u548c<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-LOGICAL-REPLICATION-WORKERS\">max_logical_replication_workers</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\">max_worker_processes</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u7684\u503c\u3002\u76ee\u6807\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u5982\u679c\u8ba1\u5212\u4f7f\u7528<code class=\"option\">--enable-two-phase</code> \u5f00\u5173\uff0c\u8fd8\u9700\u8981\u9002\u5f53\u5730\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS\">max_prepared_transactions</a>\u3002</p>\n<p lang=\"zh\">\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u63a5\u53d7\u6765\u81ea\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u3002\u6e90\u670d\u52a1\u5668\u4e0d\u80fd\u5904\u4e8e\u6062\u590d\u4e2d\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-WAL-LEVEL\">wal_level</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">logical</code>\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-REPLICATION-SLOTS\">max_replication_slots</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u52a0\u73b0\u6709\u590d\u5236\u69fd\u6570\u91cf\u7684\u503c\u3002\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\">max_wal_senders</a>\u914d\u7f6e\u4e3a\u5927\u4e8e\u7b49\u4e8e\u6307\u5b9a\u6570\u636e\u5e93\u6570\u91cf\u4e0e\u73b0\u6709 WAL \u53d1\u9001\u8fdb\u7a0b\u6570\u91cf\u4e4b\u548c\u7684\u503c\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.3\">\n<h3 lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5728\u76ee\u6807\u670d\u52a1\u5668\u88ab\u63d0\u5347\u540e\u5931\u8d25\uff0c\u6570\u636e\u76ee\u5f55\u5f88\u53ef\u80fd\u5df2\u5904\u4e8e\u4e0d\u53ef\u6062\u590d\u72b6\u6001\u3002\u6b64\u65f6\u5efa\u8bae\u91cd\u65b0\u521b\u5efa\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c<span class=\"application\">pg_createsubscriber</span>\u901a\u5e38\u4f1a\u4f7f\u7528\u4e0d\u540c\u7684\u8fde\u63a5\u8bbe\u7f6e\u6765\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u56e0\u6b64\uff0c\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5e94\u8be5\u4f1a\u5931\u8d25\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e\u903b\u8f91\u590d\u5236\u4e0d\u590d\u5236 DDL \u547d\u4ee4\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\u5e94\u907f\u514d\u6267\u884c\u4f1a\u66f4\u6539\u6570\u636e\u5e93\u6a21\u5f0f\u7684 DDL \u547d\u4ee4\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u8f6c\u6362\u4e3a\u903b\u8f91\u526f\u672c\uff0c\u76f8\u5173 DDL \u53ef\u80fd\u4e0d\u4f1a\u88ab\u590d\u5236\uff0c\u4ece\u800c\u5f15\u53d1\u9519\u8bef\u3002</p>\n<p lang=\"zh\">\u82e5<span class=\"application\">pg_createsubscriber</span>\u5904\u7406\u8fc7\u7a0b\u4e2d\u5931\u8d25\uff0c\u4f1a\u5220\u9664\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u5bf9\u8c61\uff08\u53d1\u5e03\u3001\u590d\u5236\u69fd\uff09\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u65e0\u6cd5\u8fde\u63a5\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5220\u9664\u53ef\u80fd\u5931\u8d25\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8b66\u544a\u6d88\u606f\u4f1a\u63d0\u793a\u9057\u7559\u7684\u5bf9\u8c61\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u5b83\u4f1a\u88ab\u505c\u6b62\u3002</p>\n<p lang=\"zh\">\u82e5\u590d\u5236\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u5728\u903b\u8f91\u590d\u5236\u914d\u7f6e\u5b8c\u6210\u540e\u4f1a\u4ece\u6e90\u670d\u52a1\u5668\u79fb\u9664\u8be5\u590d\u5236\u69fd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u662f\u540c\u6b65\u526f\u672c\uff0c\u8fd0\u884c<span class=\"application\">pg_createsubscriber</span>\u671f\u95f4\uff0c\u4e3b\u5e93\u4e0a\u7684\u4e8b\u52a1\u63d0\u4ea4\u53ef\u80fd\u4f1a\u5728\u7b49\u5f85\u590d\u5236\u65f6\u963b\u585e\u3002</p>\n<p lang=\"zh\">\u9664\u975e\u6307\u5b9a<code class=\"option\">--enable-two-phase</code>\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u5728\u7981\u7528\u4e24\u9636\u6bb5\u63d0\u4ea4\u7684\u60c5\u51b5\u4e0b\u5efa\u7acb\u903b\u8f91\u590d\u5236\u3002\u8fd9\u610f\u5473\u7740\u4efb\u4f55\u9884\u5907\u4e8b\u52a1\u90fd\u4f1a\u5728<code class=\"command\">COMMIT PREPARED</code>\u65f6\u88ab\u590d\u5236\uff0c\u800c\u4e0d\u4f1a\u4e8b\u5148\u8fdb\u884c\u9884\u5907\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u8ba2\u9605\uff0c\u5e76\u542f\u7528<a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_createsubscriber</span>\u4f1a\u4f7f\u7528<span class=\"application\">pg_resetwal</span> \u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u76ee\u6807\u670d\u52a1\u5668\u53ef\u80fd\u4f7f\u7528\u6e90\u670d\u52a1\u5668\u7684 WAL \u6587\u4ef6\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u6709\u5907\u5e93\uff0c\u590d\u5236\u5c06\u4f1a\u4e2d\u65ad\uff0c\u5e94\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5907\u5e93\u3002</p>\n<p lang=\"zh\">\u82e5\u7f3a\u5c11\u5fc5\u9700 WAL \u6587\u4ef6\uff0c\u590d\u5236\u53ef\u80fd\u5931\u8d25\u3002\u4e3a\u907f\u514d\u8be5\u95ee\u9898\uff0c\u6e90\u670d\u52a1\u5668\u5fc5\u987b\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-MAX-SLOT-WAL-KEEP-SIZE\">max_slot_wal_keep_size</a>\u8bbe\u7f6e\u4e3a<code class=\"literal\">-1</code>\uff0c\u4ee5\u786e\u4fdd\u5fc5\u9700 WAL \u6587\u4ef6\u4e0d\u4f1a\u88ab\u63d0\u524d\u79fb\u9664\u3002</p>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.7.7.4\">\n<h3 lang=\"zh\">\u5de5\u4f5c\u539f\u7406</h3>\n<p lang=\"zh\">\u57fa\u672c\u601d\u8def\u662f\u4ece\u6e90\u670d\u52a1\u5668\u83b7\u5f97\u590d\u5236\u8d77\u70b9\uff0c\u5e76\u4ece\u8be5\u4f4d\u7f6e\u5f00\u59cb\u5efa\u7acb\u903b\u8f91\u590d\u5236\uff1a</p>\n<div class=\"procedure\">\n<ol class=\"procedure\">\n<li class=\"step\" lang=\"zh\">\n<p>\u4f7f\u7528\u6307\u5b9a\u547d\u4ee4\u884c\u9009\u9879\u542f\u52a8\u76ee\u6807\u670d\u52a1\u5668\u3002\u82e5\u76ee\u6807\u670d\u52a1\u5668\u5df2\u5728\u8fd0\u884c\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u68c0\u67e5\u76ee\u6807\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u8f6c\u6362\uff0c\u540c\u65f6\u4e5f\u4f1a\u5bf9\u6e90\u670d\u52a1\u5668\u8fdb\u884c\u4e00\u4e9b\u68c0\u67e5\u3002\u82e5\u4efb\u4e00\u524d\u7f6e\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c<span class=\"application\">pg_createsubscriber</span>\u4f1a\u62a5\u9519\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u6e90\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u7684\u6570\u636e\u5e93\u521b\u5efa\u4e00\u4e2a\u53d1\u5e03\u548c\u4e00\u4e2a\u590d\u5236\u69fd\u3002\u6bcf\u4e2a\u53d1\u5e03\u90fd\u4ee5<a class=\"link\" href=\"/docs/18/sql-createpublication.html#SQL-CREATEPUBLICATION-PARAMS-FOR-ALL-TABLES\"><code class=\"literal\">FOR ALL TABLES</code></a>\u521b\u5efa\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--publication</code>\uff0c\u53d1\u5e03\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--replication-slot</code>\uff0c\u590d\u5236\u69fd\u7684\u540d\u79f0\u6a21\u5f0f\u5982\u4e0b\uff1a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8fd9\u4e9b\u590d\u5236\u69fd\u5c06\u5728\u540e\u7eed\u6b65\u9aa4\u4e2d\u88ab\u8ba2\u9605\u4f7f\u7528\u3002\u6700\u540e\u4e00\u4e2a\u590d\u5236\u69fd\u7684 LSN \u4f1a\u5728<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\u53c2\u6570\u4e2d\u7528\u4f5c\u505c\u6b62\u70b9\uff0c\u4e5f\u4f1a\u88ab\u8ba2\u9605\u7528\u4f5c\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u4e22\u5931\u4efb\u4f55\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6062\u590d\u53c2\u6570\u5199\u5165\u76ee\u6807\u6570\u636e\u76ee\u5f55\u5e76\u91cd\u542f\u76ee\u6807\u670d\u52a1\u5668\u3002\u5b83\u6307\u5b9a\u4e86\u6062\u590d\u5c06\u63a8\u8fdb\u5230\u7684\u9884\u5199\u5f0f\u65e5\u5fd7\u4f4d\u7f6e\u7684 LSN\uff08<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-RECOVERY-TARGET-LSN\">recovery_target_lsn</a>\uff09\u3002\u5b83\u8fd8\u5c06<code class=\"literal\">promote</code>\u6307\u5b9a\u4e3a\u670d\u52a1\u5668\u5728\u8fbe\u5230\u6062\u590d\u76ee\u6807\u540e\u5e94\u6267\u884c\u7684\u52a8\u4f5c\u3002\u8fd8\u4f1a\u6dfb\u52a0\u5176\u4ed6<a class=\"link\" href=\"/docs/18/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET\" title=\"19.5.6.\u00a0\u6062\u590d\u76ee\u6807\">\u6062\u590d\u53c2\u6570</a>\uff0c\u4ee5\u907f\u514d\u6062\u590d\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u610f\u5916\u884c\u4e3a\uff0c\u4f8b\u5982\u4e00\u8fbe\u5230\u4e00\u81f4\u72b6\u6001\u5c31\u7ed3\u675f\u6062\u590d\uff08WAL \u5e94\u7ee7\u7eed\u5e94\u7528\u5230\u590d\u5236\u8d77\u59cb\u4f4d\u7f6e\uff09\uff0c\u6216\u8005\u56e0\u6307\u5b9a\u591a\u4e2a\u6062\u590d\u76ee\u6807\u800c\u5931\u8d25\u3002\u5f53\u670d\u52a1\u5668\u9000\u51fa\u5907\u5e93\u6a21\u5f0f\u5e76\u63a5\u53d7\u8bfb\u5199\u4e8b\u52a1\u65f6\uff0c\u8be5\u6b65\u9aa4\u7ed3\u675f\u3002\u5982\u679c\u8bbe\u7f6e\u4e86<code class=\"option\">--recovery-timeout</code>\u9009\u9879\uff0c\u800c\u6062\u590d\u5728\u7ed9\u5b9a\u79d2\u6570\u5185\u6ca1\u6709\u7ed3\u675f\uff0c<span class=\"application\">pg_createsubscriber</span>\u5c31\u4f1a\u7ec8\u6b62\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u4e3a\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u521b\u5efa\u8ba2\u9605\u3002\u82e5\u672a\u6307\u5b9a<code class=\"option\">--subscription</code>\uff0c\u540d\u79f0\u6a21\u5f0f\u4e3a<span class=\"quote\">\u201c<span class=\"quote\"><code class=\"literal\">pg_createsubscriber_%u_%x</code></span>\u201d</span>\uff08\u53c2\u6570\uff1a\u6570\u636e\u5e93<em class=\"parameter\"><code>oid</code></em>\u3001\u968f\u673a<em class=\"parameter\"><code>int</code></em>\uff09\u3002\u8be5\u8ba2\u9605\u4e0d\u4f1a\u590d\u5236\u6e90\u670d\u52a1\u5668\u4e0a\u7684\u73b0\u6709\u6570\u636e\uff0c\u4e5f\u4e0d\u4f1a\u521b\u5efa\u590d\u5236\u69fd\uff0c\u800c\u662f\u4f7f\u7528\u524d\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u590d\u5236\u69fd\u3002\u8ba2\u9605\u4f1a\u88ab\u521b\u5efa\uff0c\u4f46\u5c1a\u4e0d\u542f\u7528\uff0c\u56e0\u4e3a\u5fc5\u987b\u5728\u542f\u52a8\u590d\u5236\u4e4b\u524d\u5148\u5c06\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u5230\u590d\u5236\u8d77\u70b9\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5220\u9664\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u88ab\u590d\u5236\u8fc7\u6765\u7684\u53d1\u5e03\uff08\u8fd9\u4e9b\u53d1\u5e03\u662f\u5728\u590d\u5236\u8d77\u70b9\u524d\u521b\u5efa\u7684\uff09\uff0c\u5b83\u4eec\u5728\u8ba2\u9605\u8005\u4e0a\u6ca1\u6709\u7528\u9014\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5c06\u6bcf\u4e2a\u8ba2\u9605\u7684\u590d\u5236\u8fdb\u5ea6\u8bbe\u7f6e\u4e3a\u590d\u5236\u8d77\u70b9\u3002\u5f53\u76ee\u6807\u670d\u52a1\u5668\u5f00\u59cb\u6062\u590d\u8fc7\u7a0b\u65f6\uff0c\u5b83\u4f1a\u8ffd\u8d76\u5230\u590d\u5236\u8d77\u70b9\u3002\u8fd9\u6b63\u662f\u6bcf\u4e2a\u8ba2\u9605\u8981\u7528\u4f5c\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u7684 LSN\u3002\u7531\u4e8e\u8ba2\u9605\u5df2\u7ecf\u521b\u5efa\uff0c\u56e0\u6b64\u53ef\u4ee5\u53d6\u5f97\u590d\u5236\u6e90\u540d\u79f0\u3002\u4f7f\u7528\u590d\u5236\u6e90\u540d\u79f0\u548c\u590d\u5236\u8d77\u70b9\u8c03\u7528 <a class=\"link\" href=\"/docs/18/functions-admin.html#PG-REPLICATION-ORIGIN-ADVANCE\"><code class=\"function\">pg_replication_origin_advance()</code></a> \u4ee5\u8bbe\u7f6e\u521d\u59cb\u590d\u5236\u4f4d\u7f6e\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6bcf\u4e2a\u6307\u5b9a\u6570\u636e\u5e93\u7684\u8ba2\u9605\u3002\u8ba2\u9605\u5c06\u4ece\u590d\u5236\u8d77\u70b9\u5f00\u59cb\u5e94\u7528\u4e8b\u52a1\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u4f7f\u7528\u4e86<a class=\"xref\" href=\"/docs/18/runtime-config-replication.html#GUC-PRIMARY-SLOT-NAME\">primary_slot_name</a>\uff0c\u8be5\u590d\u5236\u69fd\u4e4b\u540e\u4e0d\u518d\u6709\u7528\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u82e5\u5907\u5e93\u5305\u542b<a class=\"link\" href=\"/docs/18/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS-SYNCHRONIZATION\" title=\"47.2.3.\u00a0\u590d\u5236\u69fd\u540c\u6b65\">\u6545\u969c\u5207\u6362\u590d\u5236\u69fd</a>\uff0c\u5b83\u4eec\u540e\u7eed\u65e0\u6cd5\u7ee7\u7eed\u540c\u6b65\uff0c\u6545\u5c06\u5176\u5220\u9664\u3002</p>\n</li>\n<li class=\"step\" lang=\"zh\">\n<p>\u66f4\u65b0\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u7684\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u4f1a\u8fd0\u884c<a class=\"xref\" href=\"/docs/18/app-pgresetwal.html\" title=\"pg_resetwal\"><span class=\"refentrytitle\"><span class=\"application\">pg_resetwal</span></span></a>\u6765\u4fee\u6539\u7cfb\u7edf\u6807\u8bc6\u7b26\u3002\u7531\u4e8e<code class=\"command\">pg_resetwal</code>\u7684\u8981\u6c42\uff0c\u76ee\u6807\u670d\u52a1\u5668\u4f1a\u88ab\u505c\u6b62\u3002</p>\n</li>\n</ol>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u4ece foo \u4e0a\u7684\u7269\u7406\u526f\u672c\u4e3a hr \u548c finance \u6570\u636e\u5e93\u521b\u5efa\u903b\u8f91\u526f\u672c\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_createsubscriber -D /usr/local/pgsql/data -P \"host=foo\" -d hr -d finance</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.9\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"><span class=\"refentrytitle\"><span class=\"application\">pg_basebackup</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgcreatesubscriber.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pgcreatesubscriber.html", "method": "same-major semantic node", "sha256": "04ba2c0c9c94224ef8d8f53af670adcaa704ae7d9f99bd98d03c80b805151d24", "language": "zh", "matched_nodes": ["#APP-PGCREATESUBSCRIBER/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[3]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[4]/p[1]", "#APP-PGCREATESUBSCRIBER/div[4]/p[2]", "#APP-PGCREATESUBSCRIBER/div[4]/p[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[11]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[19]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[21]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/div[1]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[23]/p[2]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[25]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[35]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[3]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[7]", "#APP-PGCREATESUBSCRIBER/div[5]/div[2]/dl[0]/dd[9]", "#APP-PGCREATESUBSCRIBER/div[5]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[1]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[2]/p[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[10]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[1]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[2]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[3]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[4]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[5]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[6]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[7]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[8]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/div[2]/ol[0]/li[9]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/h3[0]", "#APP-PGCREATESUBSCRIBER/div[6]/div[3]/p[1]", "#APP-PGCREATESUBSCRIBER/div[6]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[7]/h2[0]", "#APP-PGCREATESUBSCRIBER/div[8]/h2[0]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_createsubscriber \u2014 convert a physical replica into a new logical replica", "/versions/18/facts/0/label": "Documented executable", "/versions/18/facts/1/label": "Executable version", "/versions/18/facts/2/label": "Reference inventory", "/versions/18/facts/2/value": "Server applications", "/versions/18/facts/3/label": "Option definition groups", "/versions/18/tables/0/title": "Documented options", "/versions/18/tables/0/rows/0/summary": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription .", "/versions/18/tables/0/rows/1/summary": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported.", "/versions/18/tables/0/rows/2/summary": "The target directory that contains a cluster directory from a physical replica.", "/versions/18/tables/0/rows/3/summary": "Do everything except actually modifying the target directory.", "/versions/18/tables/0/rows/4/summary": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections.", "/versions/18/tables/0/rows/5/summary": "The connection string to the publisher. For details see Section 32.1.1 .", "/versions/18/tables/0/rows/6/summary": "The directory to use for postmaster sockets on target server. The default is current directory.", "/versions/18/tables/0/rows/7/summary": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0.", "/versions/18/tables/0/rows/8/summary": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false .", "/versions/18/tables/0/rows/9/summary": "The user name to connect as on target server. Defaults to the current operating system user name.", "/versions/18/tables/0/columns/0/label": "Option and arguments", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/0/rows/10/summary": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/18/tables/0/rows/11/summary": "Drop all objects of the specified type from specified databases on the target server.", "/versions/18/tables/0/rows/12/summary": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory.", "/versions/18/tables/0/rows/13/summary": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/14/summary": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/15/summary": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all .", "/versions/18/tables/0/rows/16/summary": "Print the pg_createsubscriber version and exit.", "/versions/18/tables/0/rows/17/summary": "Show help about pg_createsubscriber command line arguments, and exit."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "b9f1baa9f858656d11e787c270b4caccfcd572052a589c3e00fbfae1bc934b65"}, "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Create one subscription per database on the target server. Exceptions are template databases and databases that don't allow connections. To discover the list of all databases, connect to the source server using the database name specified in the --publisher-server connection string, or if not specified, the postgres database will be used, or if that does not exist, template1 will be used. Automatically generated names for subscriptions, publications, and replication slots are used when this option is specified. This option cannot be used along with --database , --publication , --replication-slot , or --subscription ."}, {"names": ["-d dbname", "--database= dbname"], "signature": "-d dbname --database= dbname", "description": "The name of the database in which to create a subscription. Multiple databases can be selected by writing multiple -d switches. This option cannot be used together with -a . If -d option is not provided, the database name will be obtained from -P option. If the database name is not specified in either the -d option, or the -P option, and -a option is not specified, an error will be reported."}, {"names": ["-D directory", "--pgdata= directory"], "signature": "-D directory --pgdata= directory", "description": "The target directory that contains a cluster directory from a physical replica."}, {"names": ["-n", "--dry-run"], "signature": "-n --dry-run", "description": "Do everything except actually modifying the target directory."}, {"names": ["-p port", "--subscriber-port= port"], "signature": "-p port --subscriber-port= port", "description": "The port number on which the target server is listening for connections. Defaults to running the target server on port 50432 to avoid unintended client connections."}, {"names": ["-P connstr", "--publisher-server= connstr"], "signature": "-P connstr --publisher-server= connstr", "description": "The connection string to the publisher. For details see Section 32.1.1 ."}, {"names": ["-s dir", "--socketdir= dir"], "signature": "-s dir --socketdir= dir", "description": "The directory to use for postmaster sockets on target server. The default is current directory."}, {"names": ["-t seconds", "--recovery-timeout= seconds"], "signature": "-t seconds --recovery-timeout= seconds", "description": "The maximum number of seconds to wait for recovery to end. Setting to 0 disables. The default is 0."}, {"names": ["-T", "--enable-two-phase"], "signature": "-T --enable-two-phase", "description": "Enables two_phase commit for the subscription. When multiple databases are specified, this option applies uniformly to all subscriptions created on those databases. The default is false ."}, {"names": ["-U username", "--subscriber-username= username"], "signature": "-U username --subscriber-username= username", "description": "The user name to connect as on target server. Defaults to the current operating system user name."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Enables verbose mode. This will cause pg_createsubscriber to output progress messages and detailed information about each step to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["--clean= objtype"], "signature": "--clean= objtype", "description": "Drop all objects of the specified type from specified databases on the target server. publications : The FOR ALL TABLES publications established for this subscriber are always dropped; specifying this object type causes all other publications replicated from the source server to be dropped as well. The objects selected to be dropped are individually logged, including during a --dry-run . There is no opportunity to affect or stop the dropping of the selected objects, so consider taking a backup of them using pg_dump ."}, {"names": ["--config-file= filename"], "signature": "--config-file= filename", "description": "Use the specified main server configuration file for the target data directory. pg_createsubscriber internally uses the pg_ctl command to start and stop the target server. It allows you to specify the actual postgresql.conf configuration file if it is stored outside the data directory."}, {"names": ["--publication= name"], "signature": "--publication= name", "description": "The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all ."}, {"names": ["--replication-slot= name"], "signature": "--replication-slot= name", "description": "The replication slot name to set up the logical replication. Multiple replication slots can be specified by writing multiple --replication-slot switches. The number of replication slot names must match the number of specified databases, otherwise an error is reported. The order of the multiple replication slot name switches must match the order of database switches. If this option is not specified, the subscription name is assigned to the replication slot name. This option cannot be used together with --all ."}, {"names": ["--subscription= name"], "signature": "--subscription= name", "description": "The subscription name to set up the logical replication. Multiple subscriptions can be specified by writing multiple --subscription switches. The number of subscription names must match the number of specified databases, otherwise an error is reported. The order of the multiple subscription name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the subscription name. This option cannot be used together with --all ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_createsubscriber version and exit."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_createsubscriber command line arguments, and exit."}], "synopsis": ["pg_createsubscriber [ option ...] { -d | --database } dbname { -D | --pgdata } datadir { -P | --publisher-server } connstr"], "environment": []}, "comparison_hash": "ab2f9ba9dc71a377cdb3a682c66b1a84f3cb3ae29cb8c1b178c5acc418bc4441", "manual_language": "zh"}, "comparison": {"left": "18", "right": "19", "status": "changed", "diff": "--- PostgreSQL 18\n+++ PostgreSQL 19\n@@ -20,10 +20,18 @@\n     {\n       \"description\": \"The target directory that contains a cluster directory from a physical replica.\",\n       \"names\": [\n-        \"-D directory\",\n-        \"--pgdata= directory\"\n+        \"-D datadir\",\n+        \"--pgdata= datadir\"\n       ],\n-      \"signature\": \"-D directory --pgdata= directory\"\n+      \"signature\": \"-D datadir --pgdata= datadir\"\n+    },\n+    {\n+      \"description\": \"Specify the name of the log directory. A new directory is created with this name if it does not exist. A subdirectory with a timestamp indicating the time at which pg_createsubscriber was run will be created. The following two log files will be created in the subdirectory. pg_createsubscriber_server.log which captures logs related to stopping and starting the standby server, pg_createsubscriber_internal.log which captures internal diagnostic output (validations, checks, etc.) By default, the umask is set to 077 so that the log files are only readable by the user running the command. However, if the target data directory is configured to allow group-read access, pg_createsubscriber will adjust the log file permissions to match. This ensures that the log file security remains consistent with the database cluster itself.\",\n+      \"names\": [\n+        \"-l directory\",\n+        \"--logdir= directory\"\n+      ],\n+      \"signature\": \"-l directory --logdir= directory\"\n     },\n     {\n       \"description\": \"Do everything except actually modifying the target directory.\",\n@@ -104,7 +112,7 @@\n       \"signature\": \"--config-file= filename\"\n     },\n     {\n-      \"description\": \"The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all .\",\n+      \"description\": \"The publication name to set up the logical replication. Multiple publications can be specified by writing multiple --publication switches. The number of publication names must match the number of specified databases, otherwise an error is reported. The order of the multiple publication name switches must match the order of database switches. If this option is not specified, a generated name is assigned to the publication name. This option cannot be used together with --all . If a specified publication already exists on the publisher, it is reused. It is useful to partially replicate the database if the specified publication includes a list of tables. If the publication does not exist, it is automatically created with FOR ALL TABLES . Use --dry-run option to preview which publications will be reused and which will be created.\",\n       \"names\": [\n         \"--publication= name\"\n       ],"}}