{"id":20809,"date":"2024-01-02T06:18:23","date_gmt":"2024-01-02T06:18:23","guid":{"rendered":"https:\/\/server.hk\/blog\/20809\/"},"modified":"2024-11-14T10:38:15","modified_gmt":"2024-11-14T02:38:15","slug":"how-to-fix-postgresql-error-code-02001-no_additional_dynamic_result_sets_returned","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/20809\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned"},"content":{"rendered":"<h1 id=\"how-to-fix-postgresql-error-code-02001-no_additional_dynamic_result_sets_returned-cVKsYVRAZl\">\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned<\/h1>\n<p>PostgreSQL \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u958b\u6e90\u95dc\u4fc2\u578b\u8cc7\u6599\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u61c9\u7528\u7a0b\u5f0f\u3002\u7136\u800c\uff0c\u8207\u5176\u4ed6\u8edf\u9ad4\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u932f\u8aa4\uff0c\u5f71\u97ff\u5176\u6b63\u5e38\u904b\u4f5c\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u6b64\u932f\u8aa4\u7684\u6210\u56e0\uff0c\u4e26\u63d0\u4f9b\u9010\u6b65\u89e3\u6c7a\u65b9\u6848\u4f86\u4fee\u5fa9\u5b83\u3002<\/p>\n<h2 id=\"understanding-the-error-cVKsYVRAZl\">\u7406\u89e3\u932f\u8aa4<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned \u767c\u751f\u5728\u57f7\u884c\u67e5\u8a62\u6642\uff0c\u8fd4\u56de\u7684\u7d50\u679c\u96c6\u4e2d\u4e0d\u5305\u542b\u4efb\u4f55\u984d\u5916\u7684\u52d5\u614b\u7d50\u679c\u96c6\u3002\u6b64\u932f\u8aa4\u901a\u5e38\u8868\u793a\u67e5\u8a62\u6216\u8cc7\u6599\u5eab\u914d\u7f6e\u5b58\u5728\u554f\u984c\u3002<\/p>\n<h2 id=\"possible-causes-cVKsYVRAZl\">\u53ef\u80fd\u7684\u6210\u56e0<\/h2>\n<p>\u6b64\u932f\u8aa4\u53ef\u80fd\u7531\u4ee5\u4e0b\u5e7e\u500b\u539f\u56e0\u5f15\u8d77\uff1a<\/p>\n<ul>\n<li><strong>\u67e5\u8a62\u932f\u8aa4\uff1a<\/strong>\u57f7\u884c\u7684\u67e5\u8a62\u53ef\u80fd\u4e0d\u6b63\u78ba\u6216\u683c\u5f0f\u932f\u8aa4\uff0c\u5c0e\u81f4\u7d50\u679c\u96c6\u70ba\u7a7a\u3002<\/li>\n<li><strong>\u7f3a\u5c11\u6216\u4e0d\u517c\u5bb9\u7684\u64f4\u5c55\uff1a<\/strong>\u5982\u679c\u67e5\u8a62\u4f9d\u8cf4\u65bc\u7279\u5b9a\u64f4\u5c55\uff0c\u800c\u9019\u4e9b\u64f4\u5c55\u7f3a\u5931\u6216\u8207\u7576\u524d PostgreSQL \u7248\u672c\u4e0d\u517c\u5bb9\uff0c\u5247\u53ef\u80fd\u7121\u6cd5\u8fd4\u56de\u984d\u5916\u7684\u52d5\u614b\u7d50\u679c\u96c6\u3002<\/li>\n<li><strong>\u8cc7\u6599\u5eab\u914d\u7f6e\uff1a<\/strong>PostgreSQL \u8cc7\u6599\u5eab\u53ef\u80fd\u914d\u7f6e\u4e0d\u7576\uff0c\u5f9e\u800c\u963b\u6b62\u751f\u6210\u984d\u5916\u7684\u52d5\u614b\u7d50\u679c\u96c6\u3002<\/li>\n<\/ul>\n<h2 id=\"fixing-the-error-cVKsYVRAZl\">\u89e3\u6c7a\u932f\u8aa4\u7684\u65b9\u6cd5<\/h2>\n<p>\u8981\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned\uff0c\u8acb\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-review-the-query-cVKsYVRAZl\">1. \u6aa2\u67e5\u67e5\u8a62<\/h3>\n<p>\u9996\u5148\u6aa2\u67e5\u5c0e\u81f4\u932f\u8aa4\u7684\u67e5\u8a62\u3002\u78ba\u4fdd\u67e5\u8a62\u8a9e\u6cd5\u6b63\u78ba\u4e26\u4e14\u7d50\u69cb\u5408\u7406\u3002\u6aa2\u67e5\u662f\u5426\u6709\u7f3a\u5931\u6216\u932f\u8aa4\u7684\u95dc\u9375\u5b57\u3001\u8868\u540d\u6216\u6b04\u4f4d\u5f15\u7528\u3002\u9032\u884c\u5fc5\u8981\u7684\u66f4\u6b63\u4e26\u91cd\u65b0\u6e2c\u8a66\u67e5\u8a62\u3002<\/p>\n<h3 id=\"2-check-for-missing-or-incompatible-extensions-cVKsYVRAZl\">2. \u6aa2\u67e5\u7f3a\u5c11\u6216\u4e0d\u517c\u5bb9\u7684\u64f4\u5c55<\/h3>\n<p>\u5982\u679c\u67e5\u8a62\u4f9d\u8cf4\u7279\u5b9a\u7684\u64f4\u5c55\uff0c\u8acb\u78ba\u8a8d\u9019\u4e9b\u64f4\u5c55\u5df2\u5b89\u88dd\u4e26\u8207\u60a8\u4f7f\u7528\u7684 PostgreSQL \u7248\u672c\u517c\u5bb9\u3002\u4f7f\u7528 <code>SELECT * FROM pg_extension;<\/code> \u547d\u4ee4\u5217\u51fa\u6240\u6709\u5df2\u5b89\u88dd\u7684\u64f4\u5c55\u3002\u5982\u679c\u6709\u4efb\u4f55\u5fc5\u9700\u7684\u64f4\u5c55\u7f3a\u5931\u6216\u4e0d\u517c\u5bb9\uff0c\u8acb\u76f8\u61c9\u5730\u5b89\u88dd\u6216\u66f4\u65b0\u5b83\u5011\u3002<\/p>\n<h3 id=\"3-verify-database-configuration-cVKsYVRAZl\">3. \u9a57\u8b49\u8cc7\u6599\u5eab\u914d\u7f6e<\/h3>\n<p>\u6aa2\u67e5 PostgreSQL \u8cc7\u6599\u5eab\u914d\u7f6e\uff0c\u4ee5\u78ba\u4fdd\u5176\u5141\u8a31\u751f\u6210\u984d\u5916\u7684\u52d5\u614b\u7d50\u679c\u96c6\u3002\u6253\u958b\u4f4d\u65bc PostgreSQL \u8cc7\u6599\u76ee\u9304\u4e2d\u7684 <code>postgresql.conf<\/code> \u6a94\u6848\u3002\u5c0b\u627e <code>max_additional_dynamic_result_sets<\/code> \u53c3\u6578\uff0c\u4e26\u78ba\u4fdd\u5176\u503c\u5927\u65bc\u96f6\u3002\u5982\u679c\u8a72\u53c3\u6578\u7f3a\u5931\u6216\u8a2d\u7f6e\u70ba\u96f6\uff0c\u8acb\u4fee\u6539\u5b83\u4e26\u91cd\u555f PostgreSQL \u670d\u52d9\u3002<\/p>\n<h3 id=\"4-update-postgresql-cVKsYVRAZl\">4. \u66f4\u65b0 PostgreSQL<\/h3>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u8f03\u820a\u7248\u672c\u7684 PostgreSQL\uff0c\u8003\u616e\u66f4\u65b0\u81f3\u6700\u65b0\u7684\u7a69\u5b9a\u7248\u672c\u3002\u8f03\u65b0\u7684\u7248\u672c\u901a\u5e38\u5305\u62ec\u932f\u8aa4\u4fee\u5fa9\u548c\u6539\u9032\uff0c\u9019\u53ef\u80fd\u6703\u89e3\u6c7a\u8a72\u932f\u8aa4\u3002<\/p>\n<h2 id=\"summary-cVKsYVRAZl\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u800c\u8a00\u4e4b\uff0cPostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a02001 &#8211; no_additional_dynamic_result_sets_returned \u53ef\u4ee5\u901a\u904e\u6aa2\u67e5\u67e5\u8a62\u3001\u78ba\u8a8d\u7f3a\u5931\u6216\u4e0d\u517c\u5bb9\u7684\u64f4\u5c55\u3001\u9a57\u8b49\u8cc7\u6599\u5eab\u914d\u7f6e\u4ee5\u53ca\u5728\u5fc5\u8981\u6642\u66f4\u65b0 PostgreSQL \u4f86\u89e3\u6c7a\u3002\u901a\u904e\u9075\u5faa\u9019\u4e9b\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u4fee\u5fa9\u6b64\u932f\u8aa4\uff0c\u78ba\u4fdd\u60a8\u7684 PostgreSQL \u8cc7\u6599\u5eab\u6b63\u5e38\u904b\u4f5c\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\u6211\u5011\u7684\u9999\u6e2f VPS \u8a17\u7ba1\u670d\u52d9\u65e8\u5728\u6eff\u8db3\u5404\u7a2e\u898f\u6a21\u4f01\u696d\u7684\u9700\u6c42\uff0c\u63d0\u4f9b\u5353\u8d8a\u7684\u6027\u80fd\u3001\u5b89\u5168\u6027\u548c\u652f\u63f4\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":[4924],"tags":[],"class_list":["post-20809","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20809","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=20809"}],"version-history":[{"count":2,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20809\/revisions"}],"predecessor-version":[{"id":24278,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20809\/revisions\/24278"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=20809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=20809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=20809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}