{"id":21284,"date":"2024-01-02T06:49:21","date_gmt":"2024-01-02T06:49:21","guid":{"rendered":"https:\/\/server.hk\/blog\/21284\/"},"modified":"2024-11-14T10:37:35","modified_gmt":"2024-11-14T02:37:35","slug":"how-to-fix-postgresql-error-code-22014-invalid_argument_for_ntile_function","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/21284\/","title":{"rendered":"\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function"},"content":{"rendered":"<h1>\u5982\u4f55\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function<\/h1>\n<p>PostgreSQL \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u958b\u6e90\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u4f01\u696d\u548c\u958b\u767c\u8005\u3002\u4e0d\u904e\uff0c\u8207\u4efb\u4f55\u8edf\u4ef6\u4e00\u6a23\uff0c\u5b83\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u932f\u8aa4\uff0c\u5f71\u97ff\u5176\u6b63\u5e38\u904b\u4f5c\u3002\u5176\u4e2d\u4e00\u500b\u932f\u8aa4\u662f PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function\u3002\u672c\u6587\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>\u4e86\u89e3 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 \u767c\u751f\u5728 ntile \u51fd\u6578\u4f7f\u7528\u4e86\u7121\u6548\u7684\u53c3\u6578\u6642\u3002ntile \u51fd\u6578\u7528\u65bc\u5c07\u7d50\u679c\u96c6\u5283\u5206\u70ba\u6307\u5b9a\u6578\u91cf\u7684\u5927\u5c0f\u76f8\u7b49\u7684\u7d44\u3002\u5982\u679c\u63d0\u4f9b\u7684\u53c3\u6578\u5c0f\u65bc\u6216\u7b49\u65bc\u96f6\uff0c\u6216\u8d85\u904e\u7d50\u679c\u96c6\u4e2d\u7684\u7e3d\u884c\u6578\uff0c\u5c31\u6703\u89f8\u767c\u6b64\u932f\u8aa4\u3002<\/p>\n<h2>\u932f\u8aa4\u7684\u6210\u56e0<\/h2>\n<ul>\n<li><strong>\u7121\u6548\u7684\u53c3\u6578\uff1a<\/strong> \u6b64\u932f\u8aa4\u6700\u5e38\u898b\u7684\u539f\u56e0\u662f\u5411 ntile \u51fd\u6578\u63d0\u4f9b\u4e86\u7121\u6548\u7684\u53c3\u6578\u3002\u78ba\u4fdd\u53c3\u6578\u662f\u6b63\u6574\u6578\uff0c\u4e26\u4e14\u4e0d\u8d85\u904e\u7d50\u679c\u96c6\u7684\u7e3d\u884c\u6578\u3002<\/li>\n<li><strong>\u8a9e\u6cd5\u932f\u8aa4\uff1a<\/strong> \u53e6\u4e00\u500b\u539f\u56e0\u53ef\u80fd\u662f\u5728\u4f7f\u7528 ntile \u51fd\u6578\u7684\u67e5\u8a62\u4e2d\u5b58\u5728\u8a9e\u6cd5\u932f\u8aa4\u3002\u4ed4\u7d30\u6aa2\u67e5\u8a9e\u6cd5\uff0c\u78ba\u4fdd\u51fd\u6578\u7684\u4f7f\u7528\u6b63\u78ba\u3002<\/li>\n<\/ul>\n<h2>\u4fee\u5fa9 PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function \u7684\u89e3\u6c7a\u65b9\u6848<\/h2>\n<ol>\n<li><strong>\u9a57\u8b49\u53c3\u6578\uff1a<\/strong>\n<ul>\n<li>\u6aa2\u67e5\u63d0\u4f9b\u7d66 ntile \u51fd\u6578\u7684\u53c3\u6578\uff0c\u78ba\u4fdd\u5b83\u662f\u6b63\u6574\u6578\u3002<\/li>\n<li>\u9a57\u8b49\u53c3\u6578\u4e0d\u8d85\u904e\u7d50\u679c\u96c6\u7684\u7e3d\u884c\u6578\u3002<\/li>\n<li>\u5982\u6709\u5fc5\u8981\uff0c\u4fee\u6539\u53c3\u6578\u4ee5\u7b26\u5408\u8981\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6aa2\u67e5\u8a9e\u6cd5\uff1a<\/strong>\n<ul>\n<li>\u4ed4\u7d30\u6aa2\u67e5\u4f7f\u7528 ntile \u51fd\u6578\u7684\u67e5\u8a62\uff0c\u67e5\u627e\u4efb\u4f55\u8a9e\u6cd5\u932f\u8aa4\u3002<\/li>\n<li>\u78ba\u4fdd\u51fd\u6578\u7684\u4f7f\u7528\u6b63\u78ba\uff0c\u62ec\u865f\u548c\u9017\u865f\u7684\u6578\u91cf\u6b63\u78ba\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4f7f\u7528\u793a\u4f8b\u6578\u64da\u9032\u884c\u6e2c\u8a66\uff1a<\/strong>\n<ul>\n<li>\u5982\u679c\u4e0d\u78ba\u5b9a\u932f\u8aa4\u7684\u539f\u56e0\uff0c\u5275\u5efa\u4e00\u500b\u793a\u4f8b\u6578\u64da\u96c6\uff0c\u4e26\u4f7f\u7528\u4e0d\u540c\u7684\u53c3\u6578\u6e2c\u8a66 ntile \u51fd\u6578\u3002<\/li>\n<li>\u9019\u5c07\u5e6b\u52a9\u8b58\u5225\u53ef\u80fd\u89f8\u767c\u932f\u8aa4\u7684\u7279\u5b9a\u6578\u64da\u76f8\u95dc\u554f\u984c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u66f4\u65b0 PostgreSQL \u7248\u672c\uff1a<\/strong>\n<ul>\n<li>\u78ba\u4fdd\u60a8\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c\u7684 PostgreSQL\u3002\u6709\u6642\uff0c\u932f\u8aa4\u53ef\u80fd\u662f\u7531\u65bc\u820a\u7248\u672c\u4e2d\u7684\u932f\u8aa4\u6216\u554f\u984c\u5f15\u8d77\u7684\u3002<\/li>\n<li>\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u901a\u5e38\u53ef\u4ee5\u89e3\u6c7a\u9019\u985e\u554f\u984c\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5c0b\u6c42\u793e\u5340\u652f\u6301\uff1a<\/strong>\n<ul>\n<li>\u5982\u679c\u932f\u8aa4\u4ecd\u7136\u5b58\u5728\u6216\u7121\u6cd5\u8b58\u5225\u539f\u56e0\uff0c\u8acb\u5411 PostgreSQL \u793e\u5340\u5c0b\u6c42\u5e6b\u52a9\u3002<\/li>\n<li>\u5728\u7dda\u8ad6\u58c7\u3001\u90f5\u4ef6\u5217\u8868\u548c\u793e\u5340\u9a45\u52d5\u7684\u652f\u6301\u6e20\u9053\u53ef\u4ee5\u63d0\u4f9b\u5bf6\u8cb4\u7684\u898b\u89e3\u548c\u89e3\u6c7a\u65b9\u6848\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>\u7e3d\u7d50<\/h2>\n<p>PostgreSQL \u932f\u8aa4\u4ee3\u78bc\uff1a22014 &#8211; invalid_argument_for_ntile_function \u53ef\u4ee5\u901a\u904e\u9a57\u8b49\u63d0\u4f9b\u7d66 ntile \u51fd\u6578\u7684\u53c3\u6578\u548c\u6aa2\u67e5\u67e5\u8a62\u7684\u8a9e\u6cd5\u4f86\u89e3\u6c7a\u3002\u4f7f\u7528\u793a\u4f8b\u6578\u64da\u9032\u884c\u6e2c\u8a66\u3001\u66f4\u65b0 PostgreSQL \u5230\u6700\u65b0\u7248\u672c\u4ee5\u53ca\u5c0b\u6c42\u793e\u5340\u652f\u6301\u4e5f\u662f\u5e6b\u52a9\u89e3\u6c7a\u6b64\u932f\u8aa4\u7684\u984d\u5916\u6b65\u9a5f\u3002\u82e5\u60a8\u9700\u8981\u53ef\u9760\u4e14\u9ad8\u6548\u7684 VPS \u8a17\u7ba1\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 Server.HK\uff0c\u9019\u662f\u884c\u696d\u5167\u7684\u9818\u5148\u4f9b\u61c9\u5546\u3002\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS \u8a17\u7ba1<\/a> \u670d\u52d9\u70ba\u60a8\u7684\u696d\u52d9\u9700\u6c42\u63d0\u4f9b\u5353\u8d8a\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\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-21284","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21284","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=21284"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21284\/revisions"}],"predecessor-version":[{"id":24236,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/21284\/revisions\/24236"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=21284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=21284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=21284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}