{"id":89,"date":"2023-01-09T01:26:40","date_gmt":"2022-07-06T09:00:45","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/"},"modified":"2025-07-31T13:56:23","modified_gmt":"2025-07-31T04:56:23","slug":"postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/","title":{"rendered":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806"},"content":{"rendered":"<h3>\u306f\u3058\u3081\u306b\u3001<\/h3>\n<p>PostgreSQL\u307e\u305f\u306fPostgres\u306f\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u4ed6\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u540c\u69d8\u306b\u3001PostgreSQL\u306f\u884c\u3068\u5217\u3067\u69cb\u6210\u3055\u308c\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u306f\u3001Structured Query Language\uff08\u4e00\u822c\u7684\u306b\u306fSQL\u3068\u3057\u3066\u77e5\u3089\u308c\u308b\uff09\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u3092\u5b9a\u7fa9\u3001\u64cd\u4f5c\u3001\u5236\u5fa1\u3001\u304a\u3088\u3073\u30af\u30a8\u30ea\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002PostgreSQL\u306f\u3001\u4eee\u60f3\u5c02\u7528\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3084\u30a6\u30a7\u30d6\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3067\u304d\u308b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30ac\u30a4\u30c9\u3067\u306f\u3001\u7279\u6a29\u3092\u9069\u5207\u306b\u7ba1\u7406\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u6a29\u9650\u3092\u4ed8\u4e0e\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5fc5\u8981\u306a\u7279\u6a29\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u5225\u3005\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u306a\u304f\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059:<\/p>\n<ul class=\"post-ul\">\n<li>One Ubuntu 22.04 server that has been configured by following our Initial Server Setup for Ubuntu 22.04 guide. After completing this prerequisite tutorial, your server should have a non-root user with sudo permissions and a basic firewall.<\/li>\n<li>To complete Step 1 of our How To Install and Use PostgreSQL on Ubuntu 22.04 tutorial to have Postgres installed on your server.<\/li>\n<\/ul>\n<p>\u6e96\u5099\u304c\u6574\u3044\u3001\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067Postgres\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308b\u72b6\u614b\u3067\u3001Postgres\u304c\u6a29\u9650\u3092\u3069\u306e\u3088\u3046\u306b\u6271\u3046\u304b\u306b\u3064\u3044\u3066\u5b66\u3073\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>PostgreSQL\u3067\u306e\u5f79\u5272\u3068\u6a29\u9650\u306e\u8868\u793a<\/h2>\n<p>Postgres\u306f\u3001\u30ed\u30fc\u30eb\u3068\u3044\u3046\u6982\u5ff5\u3092\u901a\u3058\u3066\u6a29\u9650\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002\u30ed\u30fc\u30eb\u306f\u3001\u5f93\u6765\u306eUnix\u30b9\u30bf\u30a4\u30eb\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3068\u306f\u7570\u306a\u308b\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u3068\u30b0\u30eb\u30fc\u30d7\u306e\u533a\u5225\u304c\u306a\u3044\u306e\u3067\u3059\u3002\u30ed\u30fc\u30eb\u306f\u3001\u3053\u308c\u3089\u306e\u898f\u7d04\u306e\u4e21\u65b9\u3092\u6a21\u5023\u3059\u308b\u3088\u3046\u306b\u64cd\u4f5c\u3067\u304d\u307e\u3059\u304c\u3001\u3055\u3089\u306b\u67d4\u8edf\u3067\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u3001Postgres\u306f\u30d4\u30a2\u8a8d\u8a3c\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001Postgres\u306e\u30ed\u30fc\u30eb\u306f\u3001\u5bfe\u5fdc\u3059\u308bUnix\/Linux\u30b7\u30b9\u30c6\u30e0\u30a2\u30ab\u30a6\u30f3\u30c8\u3068\u95a2\u9023\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002\u3082\u3057Postgres\u5185\u306b\u30ed\u30fc\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u540c\u3058\u540d\u524d\u306eUnix\/Linux\u30e6\u30fc\u30b6\u30fc\u540d\u3067\u305d\u306e\u30ed\u30fc\u30eb\u3068\u3057\u3066\u30b5\u30a4\u30f3\u30a4\u30f3\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u306b\u3088\u3063\u3066\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306ePostgres\u30ed\u30fc\u30eb\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u300cpostgres\u300d\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002Postgres\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u305d\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001systemctl start\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl start postgresql.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001postgres\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token parameter variable\">-u<\/span> postgres<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300cPostgreSQL\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u306f\u3001\u3059\u3050\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres@server:~$\">psql<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Postgres\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5185\u306e\u5f79\u5272\u3092\u30ea\u30b9\u30c8\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>du<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u73fe\u5728\u3001\u5f37\u529b\u306a\u7279\u6a29\u3092\u6301\u3064\u30c7\u30d5\u30a9\u30eb\u30c8\u5f79\u8077\u306f\u4e00\u3064\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2>PostgreSQL\u306b\u304a\u3051\u308b\u5f79\u5272\u306e\u4f5c\u6210<\/h2>\n<p>Postgres\u306e\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u7570\u306a\u308b\u65b9\u6cd5\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002Postgres\u5185\u90e8\u307e\u305f\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u306e\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>PostgreSQL\u5185\u304b\u3089\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<p>Postgres\u30d7\u30ed\u30f3\u30d7\u30c8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u5185\u3067\u65b0\u3057\u3044\u30ed\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306e\u4e00\u3064\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u69cb\u6587\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE ROLE <mark>new_role_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u308c\u3092\u793a\u3059\u305f\u3081\u306b\u3001&#8221;demo_role&#8221;\u3068\u3044\u3046\u65b0\u3057\u3044\u5f79\u5272\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE ROLE demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u518d\u5ea6\u5b9a\u7fa9\u6e08\u307f\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>du<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; demo_role | Cannot login | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306e\u51fa\u529b\u306b\u306f2\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<p>\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b\u5225\u306e\u65b9\u6cd5\u306f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089createuser\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001PostgreSQL\u306e\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089\u4e00\u6642\u7684\u306b\u9000\u51fa\u3059\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>q<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001\u30dd\u30b9\u30c8\u30b0\u30ec\u30b9\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token parameter variable\">-u<\/span> postgres<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>createuser\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u65b0\u3057\u3044\u5f79\u5272\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002&#8211;interactive\u30d5\u30e9\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u65b0\u3057\u3044\u5f79\u5272\u306e\u540d\u524d\u3092\u5165\u529b\u3059\u308b\u3088\u3046\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u8868\u793a\u3055\u308c\u3001\u307e\u305f\u3001\u30b9\u30fc\u30d1\u30fc\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3092\u6301\u3064\u304b\u3069\u3046\u304b\u3082\u5c0b\u306d\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u300cpostgres\u300d\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u614b\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres@server:~$\">createuser <span class=\"token parameter variable\">&#8211;interactive<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u53f0\u672c\u306b\u57fa\u3065\u3044\u3066\u3001\u3044\u304f\u3064\u304b\u306e\u9078\u629e\u80a2\u3092\u63d0\u793a\u3057\u3001\u3042\u306a\u305f\u306e\u56de\u7b54\u306b\u57fa\u3065\u3044\u3066\u3001\u6b63\u3057\u3044Postgres\u306e\u30b3\u30de\u30f3\u30c9\u3092\u3042\u306a\u305f\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Enter name of role to add: <mark>test_user<\/mark> Shall the new role be a superuser? (y\/n) <mark>n<\/mark> Shall the new role be allowed to create databases? (y\/n) <mark>n<\/mark> Shall the new role be allowed to create more new roles? (y\/n) <mark>n<\/mark><\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u308c\u3089\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u5bfe\u3057\u3066\u3059\u3079\u3066\u300c\u3044\u3044\u3048\u300d\u3068\u7b54\u3048\u308b\u3068\u3001\u524d\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u4f3c\u305f\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>psql\u306ePostgres\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u518d\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres@server:~$\">psql<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001du\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30012\u3064\u306e\u65b0\u3057\u3044\u5f79\u5272\u9593\u306e\u5dee\u7570\u3092\u660e\u3089\u304b\u306b\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\\\u3067\u59cb\u307e\u308b\u305f\u3081\u3001\u3053\u308c\u306fpsql\u72ec\u81ea\u306e\u30e1\u30bf\u30b3\u30de\u30f3\u30c9\u3067\u3042\u308a\u3001PostgreSQL\u3067\u306f\u306a\u304fpsql\u81ea\u4f53\u306b\u3088\u3063\u3066\u51e6\u7406\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>du<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; demo_role | Cannot login | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} test_user | | {}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u306b\u306f\u3001\u300c\u30ed\u30b0\u30a4\u30f3\u4e0d\u53ef\u300d\u3068\u3044\u3046\u5c5e\u6027\u304c\u30ea\u30b9\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>PostgreSQL\u306b\u304a\u3051\u308b\u5f79\u5272\u306e\u524a\u9664<\/h2>\n<p>\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3066\u3001\u5f79\u5272\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres@server:~$\">DROP ROLE <mark>role_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u3001demo_role\u306e\u5f79\u5272\u3092\u524a\u9664\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">DROP ROLE demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5b58\u5728\u3057\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>ERROR: role &#8220;demo_role&#8221; does not exist<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u72b6\u6cc1\u3092\u907f\u3051\u3001\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u3001\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u4f55\u3082\u305b\u305a\u306b\u9759\u304b\u306b\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">DROP ROLE IF EXISTS <mark>role_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u30ed\u30fc\u30eb\u306e\u6709\u52b9\u6027\u306b\u95a2\u4fc2\u306a\u304f\u3001\u30b3\u30de\u30f3\u30c9\u306f\u6b63\u5e38\u306b\u5b8c\u4e86\u3057\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067demo_role\u3092\u524a\u9664\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u7d50\u679c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">DROP ROLE IF EXISTS demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NOTICE: role &#8220;demo_role&#8221; does not exist, skipping DROP ROLE<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5f79\u5272\u306f\u73fe\u5728\u524a\u9664\u6e08\u307f\u3067\u3059\u3002(Yakuwari wa Ima Sakujo-zumi desu.)<\/p>\n<h2>\u5f79\u5272\u4f5c\u6210\u6642\u306e\u7279\u6a29\u306e\u5b9a\u7fa9<\/h2>\n<p>\u4eca\u3001\u30a2\u30eb\u30bf\u30fc\u30c9\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u6301\u3064demo_role\u3092\u518d\u4f5c\u6210\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u30e1\u30a4\u30f3\u306e\u4f5c\u6210\u7bc0\u306e\u5f8c\u306b\u3001\u5e0c\u671b\u3059\u308b\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3053\u308c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE ROLE <mark>role_name<\/mark> WITH <mark>assigned_permissions<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5b8c\u5168\u306a\u30ea\u30b9\u30c8\u3092\u898b\u308b\u306b\u306f\u3001\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>h CREATE ROLE<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Command: CREATE ROLE Description: define a new database role Syntax: CREATE ROLE name [ [ WITH ] option [ &#8230; ] ] where option can be: SUPERUSER | NOSUPERUSER | CREATEDB | NOCREATEDB | CREATEROLE | NOCREATEROLE | INHERIT | NOINHERIT | LOGIN | NOLOGIN | REPLICATION | NOREPLICATION | BYPASSRLS | NOBYPASSRLS | CONNECTION LIMIT connlimit | [ ENCRYPTED ] PASSWORD &#8216;password&#8217; | PASSWORD NULL | VALID UNTIL &#8216;timestamp&#8217; | IN ROLE role_name [, &#8230;] | IN GROUP role_name [, &#8230;] | ROLE role_name [, &#8230;] | ADMIN role_name [, &#8230;] | USER role_name [, &#8230;] | SYSID uid URL: https:\/\/www.postgresql.org\/docs\/14\/sql-createrole.html<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300cdemo_role\u300d\u30e6\u30fc\u30b6\u30fc\u306b\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30bf\u30a4\u30d7\u3059\u308b\u3053\u3068\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE ROLE demo_role WITH LOGIN<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\\du\u30b3\u30de\u30f3\u30c9\u3067\u5c5e\u6027\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u73fe\u5728\u30012\u3064\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u7279\u6a29\u304c\u307e\u3063\u305f\u304f\u540c\u3058\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; demo_role | | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} test_user | | {}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306eCREATE USER\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u5c5e\u6027\u3092\u6307\u5b9a\u305b\u305a\u306b\u3053\u306e\u72b6\u614b\u306b\u5230\u9054\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5f79\u5272\u306e\u4f5c\u6210\u6642\u306b\u81ea\u52d5\u7684\u306b\u30ed\u30b0\u30a4\u30f3\u6a29\u9650\u304c\u4e0e\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE <span class=\"token environment constant\">USER<\/span> <mark>role_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5f79\u5272\u306f\u7279\u6a29\u304c\u81ea\u52d5\u7684\u306b\u4e0e\u3048\u3089\u308c\u308b\u5f62\u3067\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>PostgreSQL\u306b\u304a\u3051\u308b\u30ed\u30fc\u30eb\u306e\u6a29\u9650\u5909\u66f4\u3092\u884c\u3046\u3002<\/h2>\n<p>\u65e2\u306b\u4f5c\u6210\u3055\u308c\u305f\u5f79\u5272\u306e\u5c5e\u6027\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001ALTER ROLE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u69cb\u6587\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">ALTER ROLE <mark>role_name<\/mark> WITH <mark>attribute_options<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u4ee5\u524d\u306b\u793a\u3057\u305f\u3088\u3046\u306b\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u3066\u518d\u4f5c\u6210\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u7279\u6a29\u306e\u5909\u66f4\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001demo_role \u3092\u4ee5\u524d\u306e\u300c\u30ed\u30b0\u30a4\u30f3\u4e0d\u53ef\u300d\u306e\u72b6\u614b\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">ALTER ROLE demo_role WITH NOLOGIN<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c\\du\u300d\u30b3\u30de\u30f3\u30c9\u3067\u5909\u66f4\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>du<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; demo_role | Cannot login | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} test_user | | {}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30ed\u30b0\u30a4\u30f3\u30a2\u30af\u30bb\u30b9\u304c\u3042\u308b\u30ed\u30fc\u30eb\u306b\u623b\u3059\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">ALTER ROLE demo_role WITH LOGIN<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u5f79\u5272\u304c\u9006\u8ee2\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>PostgreSQL\u3067\u5225\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u30ed\u30b0\u30a4\u30f3\u3059\u308b<\/h2>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068PostgreSQL\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u306e\u307f\u3001\u30e6\u30fc\u30b6\u30fc\u306f\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u304c\u8a31\u53ef\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u30bf\u30a4\u30d7\u3092\u5909\u66f4\u3059\u308b\u304b\u3001PostgreSQL\u304c\u30eb\u30fc\u30d7\u30d0\u30c3\u30af\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u63a5\u7d9a\u3067\u3042\u3063\u3066\u3082\u63a5\u7d9a\u30bf\u30a4\u30d7\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001\u63a5\u7d9a\u3057\u305f\u3044\u30e6\u30fc\u30b6\u30fc\u306e\u305f\u3081\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u3066\u3001\u8a8d\u8a3c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u524d\u306b\u4f5c\u6210\u3057\u305ftest_user\u306b\u5bfe\u3057\u3066\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>password test_user<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u78ba\u8a8d\u3059\u308b\u3088\u3046\u306b\u6c42\u3081\u3089\u308c\u307e\u3059\u3002\u305d\u308c\u3067\u306f\u3001PostgreSQL\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u7d42\u4e86\u3057\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u901a\u5e38\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u623b\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>q<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>PostgreSQL\u3067\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u969b\u306b\u30aa\u30da\u30ec\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u4e00\u81f4\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u4f7f\u7528\u3057\u3001\u540c\u3058\u540d\u524d\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u3068\u4eee\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f7f\u7528\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u660e\u78ba\u306b\u6307\u5b9a\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3066\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">psql <span class=\"token parameter variable\">-U<\/span> <mark>user_name<\/mark> <span class=\"token parameter variable\">-d<\/span> <mark>database_name<\/mark> <span class=\"token parameter variable\">-h<\/span> <span class=\"token number\">127.0<\/span>.0.1 <span class=\"token parameter variable\">-W<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306f\u3001\u30b3\u30de\u30f3\u30c9\u306e\u5404\u9805\u76ee\u306e\u7c21\u5358\u306a\u8aac\u660e\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>The user_name should be replaced with the username you want to connect with.<\/li>\n<li>The database_name should be the name of an existing database that you have access to.<\/li>\n<li>The -h 127.0.0.1 section is the part that specifies that you will be connecting to the local machine, but through a network interface, which allows you to authenticate even though your system username does not match.<\/li>\n<li>The -W flag tells PostgreSQL that you will be entering a password.<\/li>\n<\/ul>\n<p>\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u767a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> psql <span class=\"token parameter variable\">-U<\/span> <mark>test_user<\/mark> <span class=\"token parameter variable\">-d<\/span> postgres <span class=\"token parameter variable\">-h<\/span> <span class=\"token number\">127.0<\/span>.0.1 <span class=\"token parameter variable\">-W<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u5f8c\u306b\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9postgres\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3059\u3002\u3053\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3067\u4f55\u304b\u306e\u64cd\u4f5c\u3092\u8a66\u307f\u308b\u3068\u3001\u591a\u304f\u306e\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u306ftest_user\u306b\u7ba1\u7406\u6a29\u9650\u304c\u4ed8\u4e0e\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u73fe\u5728\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (Genzai no sesshon o sh\u016bry\u014d shite kudasai.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>q<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u7ba1\u7406\u8005\u306epostgresql\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u623b\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> u &#8211; postgres psql<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306b\u3001\u8a31\u53ef\u3092\u4e0e\u3048\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>PostgreSQL\u306b\u304a\u3051\u308b\u6a29\u9650\u306e\u4ed8\u4e0e<\/h2>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u969b\u3001\u901a\u5e38\u306f\u30b9\u30fc\u30d1\u30fc\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3092\u6301\u305f\u306a\u3044\u5f79\u5272\u3092\u4f5c\u6210\u3057\u305f\u5f79\u5272\u3060\u3051\u304c\u5909\u66f4\u3059\u308b\u6a29\u9650\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4ed6\u306e\u5f79\u5272\u306b\u6a29\u9650\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u6319\u52d5\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4e00\u822c\u7684\u306a\u69cb\u6587\u3092\u4f7f\u3063\u3066\u3001GRANT\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u6a29\u9650\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT <mark>permission_type<\/mark> ON <mark>table_name<\/mark> TO <mark>role_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u3053\u308c\u3089\u306e\u6982\u5ff5\u3092\u7df4\u7fd2\u3059\u308b\u305f\u3081\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE TABLE demo <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"postgres=#\">name varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"postgres=#\"><span class=\"token function\">id<\/span> serial,<\/li>\n<li data-prefix=\"postgres=#\">start_date <span class=\"token function\">date<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4f5c\u6210\u3057\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>d<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of relations Schema | Name | Type | Owner &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;- public | demo | table | postgres public | demo_id_seq | sequence | postgres (2 rows)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a00\u3044\u63db\u3048\u307e\u3059\uff081\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09\uff1a<br \/>\n\u8868\u306e\u30bf\u30a4\u30d7\u3068\u30b7\u30fc\u30b1\u30f3\u30b9\u306e\u30bf\u30a4\u30d7\u304c\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b7\u30fc\u30b1\u30f3\u30b9\u306f\u3001\u8868\u306e\u4f5c\u6210\u6642\u306bid\u30b7\u30ea\u30a2\u30eb\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306b\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u81ea\u52d5\u5897\u5206\u3059\u308b\u6574\u6570\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u65b0\u3057\u3044\u30c7\u30e2\u30c6\u30fc\u30d6\u30eb\u306b\u3044\u304f\u3064\u304b\u306e\u7279\u6a29\u3092\u30c7\u30e2\u30ed\u30fc\u30eb\u306b\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001demo_role\u30e6\u30fc\u30b6\u30fc\u306bUPDATE\u7279\u6a29\u3092\u4e0e\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT UPDATE ON demo TO demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30e6\u30fc\u30b6\u30fc\u306b\u5b8c\u5168\u306a\u6a29\u9650\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306e\u7a2e\u985e\u3092ALL\u3068\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u3001test_user\u306b\u3053\u306e\u6a29\u9650\u3092\u4ed8\u4e0e\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT ALL ON demo TO test_user<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b7\u30b9\u30c6\u30e0\u4e0a\u306e\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u306e\u6a29\u9650\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306e\u4ee3\u308f\u308a\u306b\u300cPUBLIC\u300d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT INSERT ON demo TO PUBLIC<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b0\u30e9\u30f3\u30c8\u30c6\u30fc\u30d6\u30eb\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>z<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Access privileges Schema | Name | Type | Access privileges | Column privileges | Policies &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;- public | demo | table | postgres=arwdDxt\/postgres +| | | | | demo_role=w\/postgres +| | | | | test_user=arwdDxt\/postgres+| | | | | =a\/postgres | | public | demo_id_seq | sequence | | | (2 rows)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u4e0e\u3048\u3089\u308c\u305f\u5168\u3066\u306e\u8a31\u53ef\u6a29\u304c\u660e\u3089\u304b\u306b\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30dd\u30b9\u30c8\u30b0\u30ecSQL\u3067\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u524a\u9664<\/h2>\n<p>REVOKE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6a29\u9650\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002REVOKE\u30b3\u30de\u30f3\u30c9\u306f\u3001grant\u3068\u307b\u307c\u540c\u3058\u69cb\u6587\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">REVOKE <mark>permission_type<\/mark> ON <mark>table_name<\/mark> FROM <mark>user_name<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u5185\u3067\u3082\u300cALL\u300d\u3068\u300cPUBLIC\u300d\u3068\u3044\u3046\u540c\u3058\u7701\u7565\u8a9e\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">REVOKE INSERT ON demo FROM PUBLIC<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u524d\u306b\u8a2d\u5b9a\u3057\u305f\u6a29\u9650\u306f\u3001\u73fe\u5728\u53d6\u308a\u6d88\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h2>PostgreSQL\u306b\u304a\u3044\u3066\u3001\u30b0\u30eb\u30fc\u30d7\u30ed\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3002<\/h2>\n<p>\u5f79\u5272\u306f\u67d4\u8edf\u3067\u3001\u4ed6\u306e\u5f79\u5272\u306e\u30b0\u30eb\u30fc\u30d7\u5316\u3092\u8a31\u5bb9\u3057\u3001\u5e83\u7bc4\u306a\u6a29\u9650\u5236\u5fa1\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001temporary_users\u3068\u3044\u3046\u65b0\u3057\u3044\u5f79\u5272\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u30b0\u30eb\u30fc\u30d7\u306bdemo_role\u3068test_user\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u3001\u30b0\u30eb\u30fc\u30d7\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u65b0\u3057\u3044\u5f79\u5272\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE ROLE temporary_users<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u30e6\u30fc\u30b6\u30fc\u3092\u65b0\u3057\u304f\u4f5c\u6210\u3055\u308c\u305ftemporary_users\u30b0\u30eb\u30fc\u30d7\u306b\u5272\u308a\u5f53\u3066\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT temporary_users TO demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">GRANT temporary_users TO test_user<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u308c\u304b\u3089\u306f\u3001\u500b\u3005\u306e\u30e1\u30f3\u30d0\u30fc\u3092\u500b\u5225\u306b\u7ba1\u7406\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4e00\u6642\u7684\u306a\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u306e\u5f79\u5272\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u30892\u3064\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u6a29\u9650\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u300c\u5f79\u5272\u30e1\u30f3\u30d0\u30fc\u30b7\u30c3\u30d7\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u3001\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>du<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of roles Role name | Attributes | Member of &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- demo_role | | {temporary_users} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} temporary_users | Cannot login | {} test_user | | {temporary_users}<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b0\u30eb\u30fc\u30d7\u306e\u5f79\u5272\u306e\u30e1\u30f3\u30d0\u30fc\u306f\u3001SET ROLE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u81ea\u5206\u304c\u6240\u5c5e\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u306e\u5f79\u5272\u3068\u3057\u3066\u3082\u884c\u52d5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u73fe\u5728\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308bpostgres\u30e6\u30fc\u30b6\u30fc\u306f\u3001\u30b9\u30fc\u30d1\u30fc\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u3092\u6301\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u4e00\u6642\u30e6\u30fc\u30b6\u30fc\u30b0\u30eb\u30fc\u30d7\u306e\u30e1\u30f3\u30d0\u30fc\u3067\u306f\u306a\u304f\u3066\u3082SET ROLE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">SET ROLE temporary_users<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u4f5c\u6210\u3055\u308c\u308b\u30c6\u30fc\u30d6\u30eb\u306f\u4e00\u6642\u30e6\u30fc\u30b6\u306e\u5f79\u5272\u306b\u3088\u3063\u3066\u6240\u6709\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">CREATE TABLE hello <span class=\"token punctuation\">(<\/span><\/li>\n<li data-prefix=\"postgres=#\">name varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span>,<\/li>\n<li data-prefix=\"postgres=#\"><span class=\"token function\">id<\/span> serial,<\/li>\n<li data-prefix=\"postgres=#\">start_date <span class=\"token function\">date<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u767a\u884c\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u306e\u6240\u6709\u6a29\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>d<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of relations Schema | Name | Type | Owner &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; public | demo | table | postgres public | demo_id_seq | sequence | postgres public | hello | table | temporary_users public | hello_id_seq | sequence | temporary_users (4 rows)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e00\u3064\u3060\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u6b21\u306e\u6587\u7ae0\u3092\u65e5\u672c\u8a9e\u3067\u8868\u73fe\u3057\u307e\u3059\uff1a<br \/>\n\u4e00\u6642\u7684\u306a\u30e6\u30fc\u30b6\u30fc\u306e\u5f79\u5272\u3067\u3042\u308b\u65b0\u3057\u3044\u30c6\u30fc\u30d6\u30eb\u3068\u3001\u30b7\u30ea\u30a2\u30eb\u30c7\u30fc\u30bf\u578b\u306b\u95a2\u9023\u3059\u308b\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u6240\u6709\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5143\u306e\u5f79\u5272\u8a31\u53ef\u306b\u623b\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">RESET ROLE<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>ALTER ROLE\u30b3\u30de\u30f3\u30c9\u3067\u30e6\u30fc\u30b6\u30fc\u306bINHERIT\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4e0e\u3048\u308b\u3068\u3001SET ROLE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u308f\u305a\u306b\u305d\u306e\u30e6\u30fc\u30b6\u30fc\u306f\u6240\u5c5e\u3059\u308b\u30ed\u30fc\u30eb\u306e\u3059\u3079\u3066\u306e\u6a29\u9650\u3092\u81ea\u52d5\u7684\u306b\u6301\u3064\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">ALTER ROLE test_user INHERIT<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u5f8c\u3001test_user\u306f\u3001\u81ea\u8eab\u304c\u6240\u5c5e\u3057\u3066\u3044\u308b\u5f79\u5272\u306e\u3059\u3079\u3066\u306e\u6a29\u9650\u3092\u6301\u3064\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u30b0\u30eb\u30fc\u30d7\u306e\u5f79\u5272\u307e\u305f\u306f\u305d\u306e\u4ed6\u306e\u5f79\u5272\u3092\u3001DROP ROLE\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3053\u3068\u3067\u3001temporary_users\u30b0\u30eb\u30fc\u30d7\u3067\u3053\u308c\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">DROP ROLE temporary_users<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>ERROR: role &#8220;temporary_users&#8221; cannot be dropped because some objects depend on it DETAIL: owner of sequence hello_id_seq owner of table hello<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u306f\u3001hello\u30c6\u30fc\u30d6\u30eb\u304ctemporary_users\u306b\u3088\u3063\u3066\u6240\u6709\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u306b\u306f\u3001\u6240\u6709\u6a29\u3092\u5225\u306e\u30ed\u30fc\u30eb\u306b\u79fb\u3059\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">ALTER TABLE hello OWNER TO demo_role<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u65b9\u6cd5\u3067\u3001temporary_users\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u6240\u6709\u3057\u3066\u3044\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>d<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>List of relations Schema | Name | Type | Owner &#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211; public | demo | table | postgres public | demo_id_seq | sequence | postgres public | hello | table | demo_role public | hello_id_seq | sequence | demo_role (4 rows)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u4e00\u6642\u7684\u306a\u30e6\u30fc\u30b6\u30fc\u306e\u5f79\u5272\uff08temporary_users\uff09\u3092\u6b63\u5e38\u306b\u524a\u9664\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"postgres=#\">DROP ROLE temporary_users<span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001temporary_users\u306e\u5f79\u5272\u304c\u7834\u68c4\u3055\u308c\u307e\u3059\u3002temporary_users\u306e\u524d\u30e1\u30f3\u30d0\u30fc\u306f\u524a\u9664\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3042\u306a\u305f\u306f\u73fe\u5728\u3001PostgreSQL\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6a29\u9650\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u57fa\u672c\u7684\u306a\u30b9\u30ad\u30eb\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u6a29\u9650\u3092\u7ba1\u7406\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u308b\u3053\u3068\u306f\u91cd\u8981\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4ed6\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u3053\u3068\u306a\u304f\u3001\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>PostgreSQL\u3084\u305d\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u5b66\u3073\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30ac\u30a4\u30c9\u3092\u3054\u89a7\u3044\u305f\u3060\u304f\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems<\/li>\n<li>Practice running queries with SQL<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b\u3001 PostgreSQL\u307e\u305f\u306fPostgres\u306f\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u4ed6\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u540c\u69d8\u306b\u3001PostgreSQL\u306f\u884c\u3068\u5217\u3067\u69cb\u6210\u3055\u308c\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,14],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-16","tag-14"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql\u306evps\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u7528\u65b9\u6cd5\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u306b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\" \/>\n<meta property=\"og:description\" content=\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql\u306evps\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u7528\u65b9\u6cd5\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u306b\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-06T09:00:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T04:56:23+00:00\" \/>\n<meta name=\"author\" content=\"\u685c, \u6625\u6a39\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u685c, \u6625\u6a39\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"27\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/\",\"name\":\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-07-06T09:00:45+00:00\",\"dateModified\":\"2025-07-31T04:56:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341\"},\"description\":\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341\",\"name\":\"\u685c, \u6625\u6a39\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g\",\"caption\":\"\u685c, \u6625\u6a39\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806 - Blog - Silicon Cloud","description":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql\u306evps\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u7528\u65b9\u6cd5\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u306b\/","og_locale":"ja_JP","og_type":"article","og_title":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806","og_description":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql\u306evps\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u7528\u65b9\u6cd5\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u306b\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-07-06T09:00:45+00:00","article_modified_time":"2025-07-31T04:56:23+00:00","author":"\u685c, \u6625\u6a39","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u685c, \u6625\u6a39","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"27\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/","name":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-07-06T09:00:45+00:00","dateModified":"2025-07-31T04:56:23+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341"},"description":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL\u306eVPS\u4e0a\u3067\u306e\u5f79\u5272\u306e\u4f7f\u3044\u65b9\u3068\u6a29\u9650\u306e\u7ba1\u7406\u624b\u9806"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/ff22288af1a5455571aff7586b0fb341","name":"\u685c, \u6625\u6a39","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cee48863f3d4fd7fef222498f3e71b82312aee42b7257a2dbde56394ca4e19de?s=96&d=mm&r=g","caption":"\u685c, \u6625\u6a39"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/sakuraharuki\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/postgresql%e3%81%aevps%e4%b8%8a%e3%81%a7%e3%81%ae%e5%bd%b9%e5%89%b2%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%a8%e6%a8%a9%e9%99%90%e3%81%ae%e7%ae%a1%e7%90%86%e6%89%8b%e9%a0%86%e3%81%ab\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":325689,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions\/325689"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}