{"id":21380,"date":"2024-01-02T08:25:26","date_gmt":"2024-01-02T08:25:26","guid":{"rendered":"https:\/\/server.hk\/blog\/21380\/"},"modified":"2024-11-14T10:35:33","modified_gmt":"2024-11-14T02:35:33","slug":"how-to-fix-postgresql-error-code-39000-external_routine_invocation_exception","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21380\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception"},"content":{"rendered":"<h1 id=\"how-to-fix-postgresql-error-code-39000-external_routine_invocation_exception-YAOAzJRRwv\">\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception<\/h1>\n<p>PostgreSQL \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u958b\u6e90\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u7528\u65bc\u5404\u7a2e\u61c9\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u50cf\u4efb\u4f55\u8edf\u4ef6\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u59a8\u7919\u6b63\u5e38\u904b\u4f5c\u7684\u932f\u8aa4\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u63a2\u8a0e\u6b64\u932f\u8aa4\u7684\u539f\u56e0\uff0c\u4e26\u63d0\u4f9b\u9010\u6b65\u89e3\u6c7a\u65b9\u6848\u4f86\u4fee\u5fa9\u5b83\u3002<\/p>\n<h2 id=\"understanding-the-postgresql-error-code-39000-external_routine_invocation_exception-YAOAzJRRwv\">\u7406\u89e3 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception \u767c\u751f\u5728\u8abf\u7528\u5916\u90e8\u4f8b\u7a0b\uff08\u4f8b\u5982\u5b58\u5132\u904e\u7a0b\u6216\u51fd\u6578\uff09\u6642\u51fa\u73fe\u554f\u984c\u3002\u6b64\u932f\u8aa4\u901a\u5e38\u4f34\u96a8\u8457\u8a73\u7d30\u7684\u932f\u8aa4\u6d88\u606f\uff0c\u63d0\u4f9b\u6709\u95dc\u5177\u9ad4\u554f\u984c\u7684\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<p>\u6b64\u932f\u8aa4\u7684\u4e00\u4e9b\u5e38\u898b\u539f\u56e0\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u7f3a\u5931\u6216\u4e0d\u6b63\u78ba\u7684\u51fd\u6578\u6216\u904e\u7a0b\u5b9a\u7fa9<\/li>\n<li>\u5171\u4eab\u5eab\u6216\u52d5\u614b\u93c8\u63a5\u5eab\uff08DLL\uff09\u5b58\u5728\u554f\u984c<\/li>\n<li>\u57f7\u884c\u5916\u90e8\u4f8b\u7a0b\u7684\u6b0a\u9650\u4e0d\u8db3<\/li>\n<li>PostgreSQL \u7248\u672c\u8207\u5916\u90e8\u4f8b\u7a0b\u4e0d\u517c\u5bb9<\/li>\n<\/ul>\n<h2 id=\"fixing-the-postgresql-error-code-39000-external_routine_invocation_exception-YAOAzJRRwv\">\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u89e3\u6c7a PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception \u7684\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-check-the-function-or-procedure-definition-YAOAzJRRwv\">1. \u6aa2\u67e5\u51fd\u6578\u6216\u904e\u7a0b\u5b9a\u7fa9<\/h3>\n<p>\u78ba\u4fdd\u88ab\u8abf\u7528\u7684\u51fd\u6578\u6216\u904e\u7a0b\u5728\u6578\u64da\u5eab\u4e2d\u6b63\u78ba\u5b9a\u7fa9\u3002\u9a57\u8b49\u540d\u7a31\u3001\u53c3\u6578\u548c\u8fd4\u56de\u985e\u578b\u662f\u5426\u8207\u5be6\u969b\u5be6\u73fe\u76f8\u7b26\u3002\u5982\u679c\u6709\u4efb\u4f55\u4e0d\u4e00\u81f4\u4e4b\u8655\uff0c\u8acb\u76f8\u61c9\u5730\u66f4\u65b0\u5b9a\u7fa9\u3002<\/p>\n<h3 id=\"2-verify-the-shared-library-or-dll-YAOAzJRRwv\">2. \u9a57\u8b49\u5171\u4eab\u5eab\u6216 DLL<\/h3>\n<p>\u5982\u679c\u5916\u90e8\u4f8b\u7a0b\u4f9d\u8cf4\u65bc\u5171\u4eab\u5eab\u6216 DLL\uff0c\u8acb\u78ba\u4fdd\u5b83\u5b58\u5728\u4e26\u4e14\u5c0d PostgreSQL \u4f3a\u670d\u5668\u53ef\u8a2a\u554f\u3002\u6aa2\u67e5\u6587\u4ef6\u8def\u5f91\u548c\u6b0a\u9650\uff0c\u4ee5\u78ba\u4fdd\u4f3a\u670d\u5668\u80fd\u5920\u7121\u554f\u984c\u5730\u52a0\u8f09\u8a72\u5eab\u3002\u5982\u6709\u9700\u8981\uff0c\u91cd\u65b0\u5b89\u88dd\u6216\u66f4\u65b0\u8a72\u5eab\u3002<\/p>\n<h3 id=\"3-grant-sufficient-permissions-YAOAzJRRwv\">3. \u6388\u4e88\u8db3\u5920\u7684\u6b0a\u9650<\/h3>\n<p>\u78ba\u4fdd\u57f7\u884c\u5916\u90e8\u4f8b\u7a0b\u7684\u7528\u6236\u64c1\u6709\u5fc5\u8981\u7684\u6b0a\u9650\u3002\u4f7f\u7528\u9069\u7576\u7684 PostgreSQL \u547d\u4ee4\u6388\u4e88\u6240\u9700\u7684\u6b0a\u9650\uff0c\u4f8b\u5982 GRANT EXECUTE ON FUNCTION\u3002<\/p>\n<h3 id=\"4-check-for-version-compatibility-YAOAzJRRwv\">4. \u6aa2\u67e5\u7248\u672c\u517c\u5bb9\u6027<\/h3>\n<p>\u9a57\u8b49\u60a8\u4f7f\u7528\u7684 PostgreSQL \u7248\u672c\u662f\u5426\u8207\u5916\u90e8\u4f8b\u7a0b\u517c\u5bb9\u3002\u6709\u4e9b\u4f8b\u7a0b\u53ef\u80fd\u9700\u8981\u7279\u5b9a\u7248\u672c\u6216\u4f9d\u8cf4\u9805\u624d\u80fd\u6b63\u5e38\u904b\u884c\u3002\u5982\u679c\u5b58\u5728\u517c\u5bb9\u6027\u554f\u984c\uff0c\u8acb\u8003\u616e\u66f4\u65b0\u4f8b\u7a0b\u6216 PostgreSQL \u5b89\u88dd\u3002<\/p>\n<h3 id=\"5-review-the-error-message-YAOAzJRRwv\">5. \u6aa2\u67e5\u932f\u8aa4\u6d88\u606f<\/h3>\n<p>\u4ed4\u7d30\u6aa2\u67e5\u8207 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception \u76f8\u95dc\u7684\u932f\u8aa4\u6d88\u606f\u3002\u5b83\u53ef\u80fd\u63d0\u4f9b\u984d\u5916\u7684\u7dda\u7d22\u6216\u5177\u9ad4\u7684\u89e3\u6c7a\u554f\u984c\u7684\u6307\u793a\u3002\u53ef\u4ee5\u5728\u7dda\u641c\u7d22\u8a72\u932f\u8aa4\u6d88\u606f\u6216\u67e5\u95b1 PostgreSQL \u6587\u6a94\u4ee5\u7372\u53d6\u9032\u4e00\u6b65\u6307\u5c0e\u3002<\/p>\n<h2 id=\"summary-YAOAzJRRwv\">\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u4e4b\uff0cPostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception \u53ef\u80fd\u7531\u591a\u7a2e\u56e0\u7d20\u5f15\u8d77\uff0c\u5305\u62ec\u4e0d\u6b63\u78ba\u7684\u51fd\u6578\u6216\u904e\u7a0b\u5b9a\u7fa9\u3001\u5171\u4eab\u5eab\u6216 DLL \u7684\u554f\u984c\u3001\u6b0a\u9650\u4e0d\u8db3\u6216\u7248\u672c\u4e0d\u517c\u5bb9\u3002\u901a\u904e\u9075\u5faa\u672c\u6587\u4e2d\u6982\u8ff0\u7684\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u6392\u9664\u6545\u969c\u4e26\u89e3\u6c7a\u6b64\u932f\u8aa4\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9047\u5230 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a39000 &#8211; external_routine_invocation_exception \u6216\u5176\u4ed6\u8207\u6578\u64da\u5eab\u76f8\u95dc\u7684\u554f\u984c\uff0c\u8003\u616e\u5c0b\u6c42\u53ef\u9760\u7684 VPS \u8a17\u7ba1\u670d\u52d9\u63d0\u4f9b\u5546\u7684\u5c08\u696d\u5354\u52a9\uff0c\u4f8b\u5982 <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002\u6191\u85c9\u4ed6\u5011\u5728 PostgreSQL \u548c\u53ef\u9760\u7684\u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\u65b9\u9762\u7684\u5c08\u696d\u77e5\u8b58\uff0c\u4ed6\u5011\u53ef\u4ee5\u5e6b\u52a9\u60a8\u514b\u670d\u4efb\u4f55\u6578\u64da\u5eab\u6311\u6230\uff0c\u78ba\u4fdd\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u9806\u5229\u904b\u884c\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-21380","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21380","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=21380"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21380\/revisions"}],"predecessor-version":[{"id":24114,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21380\/revisions\/24114"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}