{"id":96772,"date":"2024-10-20T12:14:14","date_gmt":"2024-10-20T04:14:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/96772\/"},"modified":"2024-10-20T12:14:14","modified_gmt":"2024-10-20T04:14:14","slug":"postgresql-22p06-nonstandard_use_of_escape_character-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/96772\/","title":{"rendered":"PostgreSQL 22P06: nonstandard_use_of_escape_character \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"postgresql-22p06-nonstandard_use_of_escape_character-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86-RYfmQGKEXQ\">PostgreSQL 22P06: nonstandard_use_of_escape_character \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 PostgreSQL \u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\u4ee3\u78bc\uff0c\u5176\u4e2d\u4e4b\u4e00\u662f 22P06\uff0c\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207\u975e\u6a19\u6e96\u7684\u8f49\u7fa9\u5b57\u7b26\u4f7f\u7528\u6709\u95dc\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u6210\u56e0\u3001\u4fee\u5fa9\u65b9\u6cd5\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u9060\u7a0b\u8655\u7406\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e4%bb%a3%e7%a2%bc-22p06-%e7%9a%84%e6%88%90%e5%9b%a0-RYfmQGKEXQ\">\u932f\u8aa4\u4ee3\u78bc 22P06 \u7684\u6210\u56e0<\/h2>\n<p>PostgreSQL \u7684\u932f\u8aa4\u4ee3\u78bc 22P06 \u8868\u793a\u300c\u975e\u6a19\u6e96\u4f7f\u7528\u7684\u8f49\u7fa9\u5b57\u7b26\u300d\u3002\u9019\u901a\u5e38\u767c\u751f\u5728 SQL \u67e5\u8a62\u4e2d\uff0c\u7576\u958b\u767c\u8005\u4f7f\u7528\u4e86\u4e0d\u7b26\u5408 PostgreSQL \u6a19\u6e96\u7684\u8f49\u7fa9\u5b57\u7b26\u6642\u3002\u4f8b\u5982\uff0c\u5728\u5b57\u7b26\u4e32\u4e2d\u4f7f\u7528\u4e86\u4e0d\u6b63\u78ba\u7684\u53cd\u659c\u6760\uff08\uff09\u6216\u5176\u4ed6\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u53ef\u80fd\u5f15\u767c\u6b64\u932f\u8aa4\u7684 SQL \u67e5\u8a62\u793a\u4f8b\uff1a<\/p>\n<pre><code>SELECT * FROM users WHERE username = 'john's';\n<\/code><\/pre>\n<p>\u5728\u9019\u500b\u4f8b\u5b50\u4e2d\uff0c\u958b\u767c\u8005\u8a66\u5716\u67e5\u8a62\u7528\u6236\u540d\u70ba &#8220;john&#8217;s&#8221; \u7684\u8a18\u9304\uff0c\u4f46\u4f7f\u7528\u4e86\u4e0d\u6b63\u78ba\u7684\u8f49\u7fa9\u5b57\u7b26\uff0c\u5c0e\u81f4 PostgreSQL \u7121\u6cd5\u6b63\u78ba\u89e3\u6790\u8a72\u67e5\u8a62\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%96%b9%e6%b3%95-RYfmQGKEXQ\">\u6545\u969c\u4fee\u5fa9\u65b9\u6cd5<\/h2>\n<p>\u8981\u4fee\u5fa9 22P06 \u932f\u8aa4\uff0c\u958b\u767c\u8005\u9700\u8981\u6aa2\u67e5 SQL \u67e5\u8a62\u4e2d\u7684\u8f49\u7fa9\u5b57\u7b26\u4f7f\u7528\u60c5\u6cc1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u4fee\u5fa9\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u6b63\u78ba\u7684\u8f49\u7fa9\u5b57\u7b26\uff1a<\/strong>\u5728 PostgreSQL \u4e2d\uff0c\u6b63\u78ba\u7684\u8f49\u7fa9\u5b57\u7b26\u662f\u5169\u500b\u9023\u7e8c\u7684\u55ae\u5f15\u865f\uff08&#8221;\uff09\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<pre><code>SELECT * FROM users WHERE username = 'john''s';\n<\/code><\/pre>\n<ul>\n<li><strong>\u907f\u514d\u4f7f\u7528\u53cd\u659c\u6760\uff1a<\/strong>\u5728 PostgreSQL \u4e2d\uff0c\u53cd\u659c\u6760\uff08\uff09\u4e26\u4e0d\u662f\u6a19\u6e96\u7684\u8f49\u7fa9\u5b57\u7b26\uff0c\u61c9\u907f\u514d\u4f7f\u7528\u3002<\/li>\n<li><strong>\u4f7f\u7528\u539f\u59cb\u5b57\u7b26\u4e32\uff1a<\/strong>\u5982\u679c\u9700\u8981\u5728\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\u7279\u6b8a\u5b57\u7b26\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528\u539f\u59cb\u5b57\u7b26\u4e32\u8a9e\u6cd5\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<pre><code>SELECT * FROM users WHERE username = E'john\\'s';\n<\/code><\/pre>\n<p>\u9019\u6a23\u53ef\u4ee5\u6b63\u78ba\u8655\u7406\u5b57\u7b26\u4e32\u4e2d\u7684\u7279\u6b8a\u5b57\u7b26\uff0c\u907f\u514d\u5f15\u767c\u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86-postgresql-%e9%8c%af%e8%aa%a4-RYfmQGKEXQ\">\u9060\u7a0b\u8655\u7406 PostgreSQL \u932f\u8aa4<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u958b\u767c\u8005\u53ef\u80fd\u9700\u8981\u9060\u7a0b\u8655\u7406 PostgreSQL \u932f\u8aa4\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u5e7e\u7a2e\u65b9\u5f0f\u5be6\u73fe\uff1a<\/p>\n<ul>\n<li><strong>\u4f7f\u7528\u9060\u7a0b\u9023\u63a5\u5de5\u5177\uff1a<\/strong>\u53ef\u4ee5\u4f7f\u7528 pgAdmin \u6216\u5176\u4ed6 SQL \u5ba2\u6236\u7aef\u5de5\u5177\uff0c\u901a\u904e SSH \u96a7\u9053\u9023\u63a5\u5230\u9060\u7a0b PostgreSQL \u4f3a\u670d\u5668\uff0c\u9032\u884c\u67e5\u8a62\u548c\u6545\u969c\u6392\u9664\u3002<\/li>\n<li><strong>\u65e5\u8a8c\u6a94\u6848\u5206\u6790\uff1a<\/strong>\u6aa2\u67e5 PostgreSQL \u7684\u65e5\u8a8c\u6a94\u6848\uff0c\u901a\u5e38\u53ef\u4ee5\u627e\u5230\u66f4\u8a73\u7d30\u7684\u932f\u8aa4\u4fe1\u606f\uff0c\u5e6b\u52a9\u5b9a\u4f4d\u554f\u984c\u3002<\/li>\n<li><strong>\u4f7f\u7528 SQL \u8a9e\u53e5\u9032\u884c\u8abf\u8a66\uff1a<\/strong>\u53ef\u4ee5\u5728\u9060\u7a0b\u4f3a\u670d\u5668\u4e0a\u57f7\u884c\u7c21\u55ae\u7684 SQL \u8a9e\u53e5\uff0c\u6aa2\u67e5\u6578\u64da\u5eab\u7684\u72c0\u614b\u548c\u7d50\u69cb\uff0c\u78ba\u4fdd\u4e00\u5207\u6b63\u5e38\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-RYfmQGKEXQ\">\u7e3d\u7d50<\/h2>\n<p>PostgreSQL \u7684\u932f\u8aa4\u4ee3\u78bc 22P06 \u4e3b\u8981\u8207\u975e\u6a19\u6e96\u7684\u8f49\u7fa9\u5b57\u7b26\u4f7f\u7528\u6709\u95dc\u3002\u901a\u904e\u6b63\u78ba\u4f7f\u7528\u8f49\u7fa9\u5b57\u7b26\u548c\u539f\u59cb\u5b57\u7b26\u4e32\u8a9e\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u907f\u514d\u6b64\u932f\u8aa4\u7684\u767c\u751f\u3002\u6b64\u5916\uff0c\u9060\u7a0b\u8655\u7406 PostgreSQL \u932f\u8aa4\u6642\uff0c\u4f7f\u7528\u5408\u9069\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u4e5f\u80fd\u63d0\u9ad8\u6545\u969c\u6392\u9664\u7684\u6548\u7387\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u7528\u6236\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u5c07\u662f\u660e\u667a\u7684\u9078\u64c7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to troubleshoot and fix the PostgreSQL 22P06 error related to nonstandard use of escape characters with remote handling solutions.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-96772","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96772","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=96772"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96772\/revisions"}],"predecessor-version":[{"id":96773,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96772\/revisions\/96773"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=96772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=96772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=96772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}