{"id":20370,"date":"2024-01-02T05:03:18","date_gmt":"2024-01-02T05:03:18","guid":{"rendered":"https:\/\/server.hk\/blog\/20370\/"},"modified":"2024-11-14T10:39:38","modified_gmt":"2024-11-14T02:39:38","slug":"postgresql-command-drop-role","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/20370\/","title":{"rendered":"PostgreSQL \u6307\u4ee4\uff1aDROP ROLE"},"content":{"rendered":"<h1 id=\"postgresql-command-drop-role-LxLUFcANaG\">PostgreSQL \u6307\u4ee4\uff1aDROP ROLE<\/h1>\n<p>PostgreSQL \u662f\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u958b\u6e90\u95dc\u806f\u5f0f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u63d0\u4f9b\u5ee3\u6cdb\u7684\u529f\u80fd\u548c\u7279\u6027\u3002\u5728 PostgreSQL \u4e2d\uff0cDROP ROLE \u6307\u4ee4\u662f\u4e00\u500b\u91cd\u8981\u7684\u6307\u4ee4\uff0c\u5141\u8a31\u7528\u6236\u5f9e\u6578\u64da\u5eab\u4e2d\u79fb\u9664\u4e00\u500b\u89d2\u8272\u3002<\/p>\n<h2 id=\"understanding-roles-in-postgresql-LxLUFcANaG\">\u7406\u89e3 PostgreSQL \u4e2d\u7684\u89d2\u8272<\/h2>\n<p>\u5728 PostgreSQL \u4e2d\uff0c\u89d2\u8272\u7528\u65bc\u7ba1\u7406\u7528\u6236\u8a2a\u554f\u6b0a\u9650\u3002\u89d2\u8272\u53ef\u4ee5\u88ab\u8996\u70ba\u5177\u6709\u7279\u5b9a\u6b0a\u9650\u7684\u7528\u6236\u6216\u7528\u6236\u7d44\u3002\u89d2\u8272\u53ef\u4ee5\u64c1\u6709\u5404\u7a2e\u6b0a\u9650\uff0c\u4f8b\u5982\u5275\u5efa\u6216\u4fee\u6539\u6578\u64da\u5eab\u5c0d\u8c61\u3001\u57f7\u884c\u67d0\u4e9b\u6307\u4ee4\uff0c\u751a\u81f3\u7ba1\u7406\u5176\u4ed6\u89d2\u8272\u3002<\/p>\n<p>\u7576\u4e00\u500b\u89d2\u8272\u88ab\u5275\u5efa\u6642\uff0c\u5b83\u53ef\u4ee5\u88ab\u5206\u914d\u7d66\u4e00\u500b\u6216\u591a\u500b\u7528\u6236\uff0c\u8b93\u4ed6\u5011\u7e7c\u627f\u8207\u8a72\u89d2\u8272\u76f8\u95dc\u7684\u6b0a\u9650\u3002\u89d2\u8272\u9084\u53ef\u4ee5\u88ab\u6388\u4e88\u6216\u64a4\u92b7\u7279\u5b9a\u6b0a\u9650\uff0c\u5f9e\u800c\u63d0\u4f9b\u5c0d\u6578\u64da\u5eab\u8a2a\u554f\u7684\u7d30\u7c92\u5ea6\u63a7\u5236\u3002<\/p>\n<h2 id=\"the-drop-role-command-LxLUFcANaG\">DROP ROLE \u6307\u4ee4<\/h2>\n<p>PostgreSQL \u4e2d\u7684 DROP ROLE \u6307\u4ee4\u5141\u8a31\u7ba1\u7406\u54e1\u5f9e\u6578\u64da\u5eab\u4e2d\u79fb\u9664\u4e00\u500b\u89d2\u8272\u3002DROP ROLE \u6307\u4ee4\u7684\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>DROP ROLE role_name;\r\n<\/code><\/pre>\n<p>\u6b64\u8655\uff0c<code>role_name<\/code> \u6307\u7684\u662f\u60a8\u5e0c\u671b\u79fb\u9664\u7684\u89d2\u8272\u540d\u7a31\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u53ea\u6709\u8d85\u7d1a\u7528\u6236\u6216\u88ab\u79fb\u9664\u7684\u89d2\u8272\u672c\u4eba\u53ef\u4ee5\u57f7\u884c DROP ROLE \u6307\u4ee4\u3002<\/p>\n<p>\u7576\u57f7\u884c DROP ROLE \u6307\u4ee4\u6642\uff0cPostgreSQL \u5c07\u5f9e\u6578\u64da\u5eab\u4e2d\u79fb\u9664\u6307\u5b9a\u89d2\u8272\uff0c\u5305\u62ec\u6240\u6709\u8207\u4e4b\u76f8\u95dc\u7684\u6b0a\u9650\u548c\u8a31\u53ef\u3002\u5982\u679c\u88ab\u79fb\u9664\u7684\u89d2\u8272\u662f\u5176\u4ed6\u89d2\u8272\u7684\u6210\u54e1\uff0c\u5b83\u4e5f\u6703\u81ea\u52d5\u5f9e\u90a3\u4e9b\u89d2\u8272\u4e2d\u88ab\u79fb\u9664\u3002<\/p>\n<h2 id=\"examples-LxLUFcANaG\">\u793a\u4f8b<\/h2>\n<p>\u8b93\u6211\u5011\u770b\u5e7e\u500b\u793a\u4f8b\u4f86\u7406\u89e3 DROP ROLE \u6307\u4ee4\u7684\u904b\u4f5c\uff1a<\/p>\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n<pre><code>DROP ROLE analyst;\r\n<\/code><\/pre>\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u540d\u70ba &#8220;analyst&#8221; \u7684\u89d2\u8272\u5c07\u88ab\u5f9e\u6578\u64da\u5eab\u4e2d\u79fb\u9664\u3002\u4efb\u4f55\u88ab\u5206\u914d\u5230\u6b64\u89d2\u8272\u7684\u7528\u6236\u5c07\u5931\u53bb\u4ed6\u5011\u7684\u76f8\u95dc\u6b0a\u9650\u3002<\/p>\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><\/p>\n<pre><code>DROP ROLE manager;\r\n<\/code><\/pre>\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u540d\u70ba &#8220;manager&#8221; \u7684\u89d2\u8272\u5c07\u88ab\u5f9e\u6578\u64da\u5eab\u4e2d\u79fb\u9664\u3002\u5982\u679c\u6b64\u89d2\u8272\u662f\u5176\u4ed6\u89d2\u8272\u7684\u6210\u54e1\uff0c\u5b83\u4e5f\u5c07\u81ea\u52d5\u5f9e\u90a3\u4e9b\u89d2\u8272\u4e2d\u88ab\u79fb\u9664\u3002<\/p>\n<h2 id=\"summary-LxLUFcANaG\">\u7e3d\u7d50<\/h2>\n<p>PostgreSQL \u4e2d\u7684 DROP ROLE \u6307\u4ee4\u662f\u4e00\u500b\u5f37\u5927\u7684\u5de5\u5177\uff0c\u7528\u65bc\u7ba1\u7406\u6578\u64da\u5eab\u4e2d\u7684\u89d2\u8272\u548c\u7528\u6236\u8a2a\u554f\u3002\u5b83\u5141\u8a31\u7ba1\u7406\u54e1\u5f9e\u7cfb\u7d71\u4e2d\u79fb\u9664\u89d2\u8272\u53ca\u5176\u76f8\u95dc\u7684\u6b0a\u9650\u3002\u901a\u904e\u4f7f\u7528 DROP ROLE \u6307\u4ee4\uff0c\u60a8\u53ef\u4ee5\u7dad\u8b77\u4e00\u500b\u5b89\u5168\u4e14\u7d44\u7e54\u826f\u597d\u7684 PostgreSQL \u6578\u64da\u5eab\u3002<\/p>\n<p>\u82e5\u8981\u4e86\u89e3\u6709\u95dc VPS \u8a17\u7ba1\u7684\u66f4\u591a\u4fe1\u606f\u4e26\u63a2\u7d22\u6211\u5011\u7684\u9ad8\u6548\u80fd\u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8a2a\u554f <a href=\"https:\/\/server.hk\">Server.HK<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL \u6307\u4ee4\uff1aDR&#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-20370","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20370","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=20370"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20370\/revisions"}],"predecessor-version":[{"id":24382,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/20370\/revisions\/24382"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=20370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=20370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=20370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}