{"id":21323,"date":"2024-01-02T07:28:26","date_gmt":"2024-01-02T07:28:26","guid":{"rendered":"https:\/\/server.hk\/blog\/21323\/"},"modified":"2024-11-14T10:36:45","modified_gmt":"2024-11-14T02:36:45","slug":"how-to-fix-postgresql-error-code-2200s-invalid_xml_comment","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21323\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment"},"content":{"rendered":"<h1 id=\"how-to-fix-postgresql-error-code-2200s-invalid_xml_comment-xVVGxCkIMu\">\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment<\/h1>\n<p>PostgreSQL \u662f\u4e00\u6b3e\u529f\u80fd\u5f37\u5927\u7684\u958b\u6e90\u95dc\u806f\u5f0f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u61c9\u7528\u3002\u7136\u800c\uff0c\u50cf\u6240\u6709\u8edf\u9ad4\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u59a8\u7919\u5176\u6b63\u5e38\u904b\u4f5c\u7684\u932f\u8aa4\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u6b64\u932f\u8aa4\u7684\u6210\u56e0\u4e26\u63d0\u4f9b\u9010\u6b65\u89e3\u6c7a\u65b9\u6848\u4f86\u4fee\u5fa9\u5b83\u3002<\/p>\n<h2 id=\"understanding-the-postgresql-error-code-2200s-invalid_xml_comment-xVVGxCkIMu\">\u4e86\u89e3 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment \u767c\u751f\u5728\u6578\u64da\u5eab\u4e2d\u7684 XML \u8a3b\u91cb\u51fa\u73fe\u554f\u984c\u6642\u3002XML \u8a3b\u91cb\u7528\u65bc\u5728 XML \u6587\u6a94\u4e2d\u63d0\u4f9b\u984d\u5916\u7684\u4fe1\u606f\u6216\u89e3\u91cb\u3002\u7136\u800c\uff0c\u82e5\u8a3b\u91cb\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u5305\u542b\u7121\u6548\u5b57\u7b26\uff0cPostgreSQL \u5c07\u5f15\u767c\u6b64\u932f\u8aa4\u3002<\/p>\n<h2 id=\"possible-causes-of-the-error-xVVGxCkIMu\">\u932f\u8aa4\u7684\u53ef\u80fd\u6210\u56e0<\/h2>\n<p>\u9020\u6210 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment \u7684\u539f\u56e0\u6709\u5e7e\u500b\uff1a<\/p>\n<ul>\n<li><strong>\u7121\u6548\u5b57\u7b26\uff1a<\/strong> XML \u8a3b\u91cb\u53ef\u80fd\u5305\u542b\u4e0d\u88ab\u5141\u8a31\u6216\u672a\u6b63\u78ba\u7de8\u78bc\u7684\u5b57\u7b26\u3002<\/li>\n<li><strong>\u683c\u5f0f\u4e0d\u6b63\u78ba\uff1a<\/strong> XML \u8a3b\u91cb\u7684\u8a9e\u6cd5\u6216\u7d50\u69cb\u53ef\u80fd\u4e0d\u6b63\u78ba\u3002<\/li>\n<li><strong>\u7de8\u78bc\u554f\u984c\uff1a<\/strong> XML \u8a3b\u91cb\u53ef\u80fd\u5b58\u5728\u7de8\u78bc\u554f\u984c\uff0c\u4f8b\u5982\u4f7f\u7528\u4e0d\u76f8\u5bb9\u7684\u5b57\u7b26\u96c6\u3002<\/li>\n<\/ul>\n<h2 id=\"fixing-the-postgresql-error-code-2200s-invalid_xml_comment-xVVGxCkIMu\">\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment<\/h2>\n<p>\u8981\u89e3\u6c7a PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment\uff0c\u8acb\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u64cd\u4f5c\uff1a<\/p>\n<h3 id=\"step-1-identify-the-problematic-xml-comment-xVVGxCkIMu\">\u6b65\u9a5f 1\uff1a\u8b58\u5225\u554f\u984c XML \u8a3b\u91cb<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u5b9a\u5c0e\u81f4\u932f\u8aa4\u7684\u5177\u9ad4 XML \u8a3b\u91cb\u3002\u53ef\u4ee5\u901a\u904e\u6aa2\u67e5\u932f\u8aa4\u6d88\u606f\u6216\u76f8\u95dc\u7684\u6578\u64da\u5eab\u67e5\u8a62\u4f86\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002<\/p>\n<h3 id=\"step-2-check-for-invalid-characters-xVVGxCkIMu\">\u6b65\u9a5f 2\uff1a\u6aa2\u67e5\u7121\u6548\u5b57\u7b26<\/h3>\n<p>\u6aa2\u67e5 XML \u8a3b\u91cb\u662f\u5426\u5b58\u5728\u7121\u6548\u5b57\u7b26\u3002\u78ba\u4fdd\u6240\u6709\u5b57\u7b26\u5747\u5df2\u6b63\u78ba\u7de8\u78bc\uff0c\u4e26\u9075\u5faa XML \u898f\u7bc4\u3002\u5982\u679c\u767c\u73fe\u4efb\u4f55\u7121\u6548\u5b57\u7b26\uff0c\u8acb\u76f8\u61c9\u5730\u522a\u9664\u6216\u66ff\u63db\u5b83\u5011\u3002<\/p>\n<h3 id=\"step-3-verify-the-comments-formatting-xVVGxCkIMu\">\u6b65\u9a5f 3\uff1a\u9a57\u8b49\u8a3b\u91cb\u7684\u683c\u5f0f<\/h3>\n<p>\u6aa2\u67e5 XML \u8a3b\u91cb\u662f\u5426\u9075\u5faa\u6b63\u78ba\u7684\u683c\u5f0f\u898f\u5247\u3002\u78ba\u4fdd\u5b83\u4ee5 &#8220;<code>&lt;!--<\/code>&#8221; \u958b\u59cb\u4e26\u4ee5 &#8220;<code>--&gt;<\/code>&#8221; \u7d50\u675f\u3002\u6b64\u5916\uff0c\u8acb\u78ba\u4fdd\u5728 XML \u8a3b\u91cb\u4e2d\u6c92\u6709\u5d4c\u5957\u8a3b\u91cb\u3002<\/p>\n<h3 id=\"step-4-resolve-encoding-issues-xVVGxCkIMu\">\u6b65\u9a5f 4\uff1a\u89e3\u6c7a\u7de8\u78bc\u554f\u984c<\/h3>\n<p>\u5982\u679c XML \u8a3b\u91cb\u6709\u7de8\u78bc\u554f\u984c\uff0c\u5247\u9700\u8981\u9032\u884c\u8655\u7406\u3002\u78ba\u4fdd XML \u8a3b\u91cb\u4e2d\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u8207\u60a8\u7684 PostgreSQL \u6578\u64da\u5eab\u7684\u7de8\u78bc\u8a2d\u7f6e\u76f8\u5339\u914d\u3002\u5982\u6709\u5fc5\u8981\uff0c\u8acb\u5c07\u8a3b\u91cb\u8f49\u63db\u70ba\u9069\u7576\u7684\u5b57\u7b26\u96c6\u3002<\/p>\n<h3 id=\"step-5-update-the-xml-comment-xVVGxCkIMu\">\u6b65\u9a5f 5\uff1a\u66f4\u65b0 XML \u8a3b\u91cb<\/h3>\n<p>\u5b8c\u6210\u5fc5\u8981\u7684\u66f4\u6539\u5f8c\uff0c\u8acb\u66f4\u65b0\u6578\u64da\u5eab\u4e2d\u7684 XML \u8a3b\u91cb\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528 SQL \u547d\u4ee4\u6216\u6578\u64da\u5eab\u7ba1\u7406\u5de5\u5177\u4f86\u4fee\u6539\u8a72\u8a3b\u91cb\u3002<\/p>\n<h2 id=\"summary-xVVGxCkIMu\">\u6458\u8981<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a2200S &#8211; invalid_xml_comment \u53ef\u4ee5\u901a\u904e\u4ed4\u7d30\u6aa2\u67e5\u4e26\u4fee\u5fa9\u554f\u984c XML \u8a3b\u91cb\u4f86\u89e3\u6c7a\u3002\u78ba\u4fdd\u8a3b\u91cb\u4e2d\u4e0d\u5305\u542b\u7121\u6548\u5b57\u7b26\uff0c\u9075\u5faa\u6b63\u78ba\u7684\u683c\u5f0f\uff0c\u4e26\u5177\u6709\u9069\u7576\u7684\u7de8\u78bc\u3002\u6309\u7167\u672c\u6587\u6240\u8ff0\u7684\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u6210\u529f\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u78ba\u4fdd\u60a8\u7684 PostgreSQL \u6578\u64da\u5eab\u9806\u5229\u904b\u884c\u3002<\/p>\n<p>\u5982\u9700\u53ef\u9760\u4e14\u9ad8\u6027\u80fd\u7684 VPS \u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8003\u616e <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u6191\u85c9\u6211\u5011\u4e00\u6d41\u7684 VPS \u8a17\u7ba1\u670d\u52d9\uff0c\u60a8\u53ef\u4ee5\u4eab\u53d7\u5353\u8d8a\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\uff0c\u6eff\u8db3\u60a8\u7684 PostgreSQL \u548c\u5176\u4ed6\u61c9\u7528\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u5fa9 PostgreSQL &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-21323","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=21323"}],"version-history":[{"count":2,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21323\/revisions"}],"predecessor-version":[{"id":24191,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21323\/revisions\/24191"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}