{"id":38114,"date":"2019-03-07T09:42:44","date_gmt":"2019-03-07T00:42:44","guid":{"rendered":"https:\/\/www.ospn.jp\/press\/?p=38114"},"modified":"2019-12-03T14:26:33","modified_gmt":"2019-12-03T05:26:33","slug":"no49-use-it-oss","status":"publish","type":"post","link":"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html","title":{"rendered":"\u300c\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u300d\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046<br>\uff08\u7b2c49\u56de\uff1aOracle\u304b\u3089PostgreSQL\u3078\u306e\u79fb\u884c\u6642\u306b\u898b\u843d\u3068\u3057\u304c\u3061\u306a\u30dd\u30a4\u30f3\u30c810\u9078\uff09"},"content":{"rendered":"<div id=\"doc\" class=\"markdown-body container-fluid\">\n<h1 id=\"Oracle\u30e6\u30fc\u30b6\u304cPostgreSQL\u3092\u4f7f\u7528\u3059\u308b\u6642\u306b\u6ce8\u610f\u3059\u308b\u70b9\">Oracle\u30e6\u30fc\u30b6\u304cPostgreSQL\u3092\u4f7f\u7528\u3059\u308b\u6642\u306b\u6ce8\u610f\u3059\u308b\u70b9<\/h1>\n<p>\u306f\u3058\u3081\u307e\u3057\u3066\u3001\u30b5\u30fc\u30af\u30eb\u300c\u307e\u3050\u308d\u306e\u307f\u305e\u304a\u3061\u300d\u306e\u307e\u3050\u308d\u3068\u7533\u3057\u307e\u3059\u3002<\/p>\n<p>\u5f0a\u30b5\u30fc\u30af\u30eb\u3067\u306f\u4e3b\u306bPostgreSQL\u306b\u95a2\u3059\u308b\u77e5\u8b58\u3092\u540c\u4eba\u8a8c\u306b\u307e\u3068\u3081\u3066\u3001\u3088\u308a\u591a\u304f\u306e\u65b9\u306bPostgreSQL\u3092\u77e5\u3063\u3066\u3082\u3089\u3044\u3001\u30e6\u30fc\u30b6\u3092\u5897\u3084\u3059\u3053\u3068\u3067\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306b\u8ca2\u732e\u3057\u3088\u3046\u3068\u6d3b\u52d5\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u306fOracle database\u304b\u3089PostgreSQL\u306b\u79fb\u884c\u3092\u691c\u8a0e\u3059\u308b\u65b9\u3082\u591a\u304f\u3001\u30e6\u30fc\u30b6\u3092\u5897\u3084\u3059\u30c1\u30e3\u30f3\u30b9\uff01\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u79c1\u304c\u5b9f\u969b\u306bOracle\u304b\u3089PostgreSQL\u306b\u79fb\u884c\u3059\u308b\u969b\u306b\u56f0\u3063\u305f\u70b9\u3084\u3001Oracle\u30e6\u30fc\u30b6\u304b\u3089\u3053\u3053\u306f\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u306e\uff1f\u3068\u805e\u304b\u308c\u305f\u70b9\u3092\u4e2d\u5fc3\u306b\u3001Oracle\u304b\u3089PostgreSQL\u306b\u79fb\u884c\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9\u3092\u4e00\u554f\u4e00\u7b54\u5f62\u5f0f\u3067\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2 id=\"Q1-SQL\u306b\u4e92\u63db\u6027\u306f\u3042\u308a\u307e\u3059\u304b\uff1f\">Q1. SQL\u306b\u4e92\u63db\u6027\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u307b\u3068\u3093\u3069\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3044\u304f\u3064\u304b\u4fee\u6b63\u304c\u5fc5\u8981\u306a\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\">A. \u307b\u3068\u3093\u3069\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3044\u304f\u3064\u304b\u4fee\u6b63\u304c\u5fc5\u8981\u306a\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/h3>\n<p>PostgreSQL\u306fSQL\u6a19\u6e96\u306b\u3067\u304d\u308b\u9650\u308a\u5f93\u3046\u3053\u3068\u3092\u5ff5\u982d\u306b\u7f6e\u3044\u3066\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u901a\u5e38\u4f7f\u7528\u3059\u308bSQL\u306b\u95a2\u3057\u3066\u306f\u307b\u3068\u3093\u3069\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u306a\u304f\u305d\u306e\u307e\u307e\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001SQL\u6a19\u6e96\u306b\u5b8c\u5168\u306b\u5408\u81f4\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u88fd\u54c1\u3068\u3044\u3046\u306e\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002\u305d\u308c\u306fPostgreSQL\u3067\u3082Oracle\u3067\u3082\u540c\u69d8\u3067\u3001Oracle\u306e&#8221;\u65b9\u8a00&#8221;\u3092PostgreSQL\u3067\u3082\u901a\u3058\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3044\u304f\u3064\u304b\u4fee\u6b63\u70b9\u306e\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>dual\u8868\u306fOracle\u306b\u3057\u304b\u5b58\u5728\u3057\u307e\u305b\u3093\u3002\n<ul>\n<li>\u5b9f\u306fSELECT\u6587\u306fFROM\u53e5\u304c\u306a\u304f\u3066\u3082\u6587\u6cd5\u7684\u306b\u306f\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002PostgreSQL\u306b\u306fdual\u8868\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u306e\u3067\u3001\u524a\u9664\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q1_01\" rel=\"attachment wp-att-38259\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38259\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q1_01.png\" alt=\"\" width=\"500\" height=\"152\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# -- \u73fe\u5728\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308bSQL\r\npostgres=# SELECT sysdate FROM dual;\r\nERROR:  \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\"dual\"\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\r\nLINE 1: SELECT sysdate FROM dual;\r\n\r\npostgres=# SELECT current_date;\r\n current_date\r\n--------------\r\n 2019-02-26\r\n(1 row)\r\n<\/code><\/pre>\n\n\n--><\/li>\n<li>\u4e92\u63db\u6027\u306e\u306a\u3044\u95a2\u6570+\n<ul>\n<li>\u305f\u3068\u3048\u3070NVL\u95a2\u6570\u306e\u3088\u3046\u306b\u3001PostgreSQL\u306b\u306f\u5b58\u5728\u3057\u306a\u3044\u95a2\u6570\u306f\u3001\u4ee3\u66ff\u624b\u6bb5\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q1_02\" rel=\"attachment wp-att-38258\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38258\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q1_02.png\" alt=\"\" width=\"500\" height=\"180\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# --NULL\u306e\u5834\u5408\u306f99\u3092\u8fd4\u3057\u307e\u3059\u3002\r\npostgres=# SELECT NVL(sample, 99) FROM sample;\r\nERROR:  \u95a2\u6570nvl(numeric, integer)\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\r\nLINE 1: SELECT NVL(sample, 99) FROM sample;\r\n               ^\r\nHINT:  \u6307\u5b9a\u3057\u305f\u540d\u524d\u3068\u5f15\u6570\u578b\u306b\u5408\u81f4\u3059\u308b\u95a2\u6570\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u304c\u5fc5\u8981\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\r\npostgres=# SELECT COALESCE(sample, 99) FROM sample;\r\n coalesce\r\n----------\r\n       99\r\n(1 row)\r\n<\/code><\/pre>\n\n\n--><\/li>\n<li>(+)\u3067JOIN\u3057\u3066\u3044\u308b\n<ul>\n<li>Oracle\u3067\u3082\u53e4\u3044\u66f8\u304d\u65b9\u306a\u306e\u3067\u4eca\u306f\u73cd\u3057\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5f53\u7136\u3001PostgreSQL\u3067\u306f\u52d5\u304d\u307e\u305b\u3093\u3002\u901a\u5e38\u306e\u5916\u90e8\u7d50\u5408\u306b\u66f8\u304d\u63db\u3048\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u7a7a\u6587\u5b57\u5217\u306e\u6271\u3044\n<ul>\n<li>Oracle\u3067\u306f\u7a7a\u6587\u5b57\u3068NULL\u304c\u7b49\u4fa1\u306e\u6271\u3044\u3092\u3055\u308c\u307e\u3059\u3002PostgreSQL\u3067\u306f\u3082\u3061\u308d\u3093\u7570\u306a\u308b\u6271\u3044\u306b\u306a\u308b\u305f\u3081\u3001NULL\u3092\u6761\u4ef6\u306b\u3057\u3066\u3044\u308bSQL\u304c\u3042\u3063\u305f\u3089\u4fee\u6b63\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"Q2-\u30c7\u30fc\u30bf\u578b\u306f\u5171\u901a\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\">Q2. \u30c7\u30fc\u30bf\u578b\u306f\u5171\u901a\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u5168\u304f\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5408\u308f\u305b\u3066\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\">A. \u5168\u304f\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5408\u308f\u305b\u3066\u4fee\u6b63\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/h3>\n<p>\u30c7\u30fc\u30bf\u578b\u306f\u5171\u901a\u3057\u3066\u3044\u308b\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u5909\u3048\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3082\u306e\u3082\u591a\u304f\u3042\u308a\u307e\u3059\u3002\u4ee3\u8868\u7684\u306a\u30c7\u30fc\u30bf\u578b\u306e\u7f6e\u304d\u63db\u3048\u306e\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q2_01\" rel=\"attachment wp-att-38257\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38257\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q2_01.png\" alt=\"\" width=\"500\" height=\"221\" \/><\/a><br \/>\n<!--\n\n\n<table>\n\n\n<thead>\n\n\n<tr>\n\n\n<th>\u5c5e\u6027<\/th>\n\n\n\n\n<th>Oracle<\/th>\n\n\n\n\n<th>PostgreSQL<\/th>\n\n\n\n\n<th>\u5099\u8003<\/th>\n\n\n<\/tr>\n\n\n<\/thead>\n\n\n\n\n<tbody>\n\n\n<tr>\n\n\n<td>\u6570\u5024\u578b<\/td>\n\n\n\n\n<td>NUMBER<\/td>\n\n\n\n\n<td>numeric<\/td>\n\n\n\n\n<td><\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u6587\u5b57\u5217\u578b<\/td>\n\n\n\n\n<td>CHAR<\/td>\n\n\n\n\n<td>char<\/td>\n\n\n\n\n<td>PostgreSQL\u3067\u306f\u6841\u6570\u306f\u30d0\u30a4\u30c8\u6570\u3067\u306f\u306a\u304f\u6587\u5b57\u6570\u3068\u3057\u3066\u6570\u3048\u308b\u3002<\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u6587\u5b57\u5217\u578b<\/td>\n\n\n\n\n<td>VARCHAR2<\/td>\n\n\n\n\n<td>varchar<\/td>\n\n\n\n\n<td>\u540c\u4e0a\u3002<\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u6587\u5b57\u5217\u578b<\/td>\n\n\n\n\n<td>NVARCHAR2<\/td>\n\n\n\n\n<td>varchar<\/td>\n\n\n\n\n<td>\u540c\u4e0a\u3002<\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u65e5\u6642<\/td>\n\n\n\n\n<td>DATE<\/td>\n\n\n\n\n<td>timestamp<\/td>\n\n\n\n\n<td>Oracle\u306eDATE\u578b\u306b\u306f\u6642\u523b\u3082\u542b\u3080\u305f\u3081\u3001PostgreSQL\u306etimestamp\u306b\u7f6e\u304d\u63db\u3048\u308b\u3002<\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u65e5\u6642<\/td>\n\n\n\n\n<td>TIMESTAMP<\/td>\n\n\n\n\n<td>timestamp<\/td>\n\n\n\n\n<td><\/td>\n\n\n<\/tr>\n\n\n\n\n<tr>\n\n\n<td>\u30d0\u30a4\u30ca\u30ea<\/td>\n\n\n\n\n<td>BLOB<\/td>\n\n\n\n\n<td>bytea<\/td>\n\n\n\n\n<td>bytea\u306e\u4e0a\u9650\u306f\uff11GB\u3002\u305d\u308c\u4ee5\u4e0a\u306f\u30e9\u30fc\u30b8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4ee5\u5916\u306b\u4fdd\u5b58\u3059\u308b\u3002<\/td>\n\n\n<\/tr>\n\n\n<\/tbody>\n\n\n<\/table>\n\n\n--><\/p>\n<h2 id=\"Q3-PostgreSQL\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3089\u3001\u30c6\u30fc\u30d6\u30eb\u540d\u304c\u5c0f\u6587\u5b57\u306b\u306a\u308a\u307e\u3057\u305f\">Q3. PostgreSQL\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3089\u3001\u30c6\u30fc\u30d6\u30eb\u540d\u304c\u5c0f\u6587\u5b57\u306b\u306a\u308a\u307e\u3057\u305f<\/h2>\n<h3 id=\"A-PostgreSQL\u3067\u306f\u3001\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002\">A. PostgreSQL\u3067\u306f\u3001\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002<\/h3>\n<p>Oracle\u3067\u306f\u30c6\u30fc\u30d6\u30eb\u540d\u3084\u30ab\u30e9\u30e0\u540d\u306b\u82f1\u5b57\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u81ea\u52d5\u3067\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002\u3057\u304b\u3057\u3001PostgreSQL\u3067\u306f\u9006\u306b\u3059\u3079\u3066\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3057\u307e\u3059\u3002PostgreSQL\u3067\u3069\u3046\u3057\u3066\u3082\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u5927\u6587\u5b57\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u3066CREATE\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q3_01\" rel=\"attachment wp-att-38256\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38256\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q3_01.png\" alt=\"\" width=\"500\" height=\"30\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-string\">\"TEST_TABLE\"<\/span> (<span class=\"hljs-string\">\"TEST\"<\/span> <span class=\"hljs-built_in\">VARCHAR<\/span>(<span class=\"hljs-number\">20<\/span>));\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u3057\u304b\u3057\u3001\u79c1\u306f\u3042\u307e\u308a\u3053\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b\u306e\u306f\u304a\u3059\u3059\u3081\u3057\u307e\u305b\u3093\u3002\u306a\u305c\u306a\u3089\u3070\u3001\u4f5c\u6210\u6642\u3060\u3051\u3067\u306f\u306a\u304f\u3001SELECT\u306a\u3069\u4ed6\u306eSQL\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u6307\u5b9a\u3059\u308b\u969b\u306b\u3082\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u307e\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u308a\u3001\u304b\u3048\u3063\u3066Oracle\u304b\u3089\u79fb\u884c\u3059\u308b\u3068\u304d\u306eSQL\u306e\u4fee\u6b63\u91cf\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q3_02\" rel=\"attachment wp-att-38255\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38255\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q3_02.png\" alt=\"\" width=\"500\" height=\"169\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# INSERT INTO \"TEST_TABLE\" (\"TEST\") VALUES ('\u307e\u3050\u308d');\r\nINSERT 0 1\r\npostgres=# SELECT * FROM TEST_TABLE;\r\nERROR:  \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\"test_table\"\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\r\nLINE 1: SELECT * FROM TEST_TABLE;\r\n\r\npostgres=# SELECT * FROM \"TEST_TABLE\";\r\n  TEST\r\n--------\r\n \u307e\u3050\u308d\r\n(1 row)\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u901a\u5e38\u306eSELECT\u6587\u3092\u66f8\u304f\u3068\u304d\u3001Oracle\u3067\u306f\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u5927\u6587\u5b57\u3067\u66f8\u3044\u3066\u3082\u5c0f\u6587\u5b57\u3067\u66f8\u3044\u3066\u3082\u7279\u306b\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u308c\u306f\u3001\u5c0f\u6587\u5b57\u3067\u66f8\u3044\u3066\u3082\u5b9f\u884c\u6642\u306b\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u308b\u304b\u3089\u3067\u3059\u3002PostgreSQL\u3067\u3082\u540c\u69d8\u3067\u3001\u305f\u3060\u5927\u6587\u5b57\u3067\u66f8\u3044\u3066\u3082\u5c0f\u6587\u5b57\u306b\u306a\u308b\u3060\u3051\u3067\u3001\u901a\u5e38\u4f7f\u7528\u3059\u308b\u5206\u306b\u306f\u30c6\u30fc\u30d6\u30eb\u540d\u304c\u5927\u6587\u5b57\u3067\u3067\u304d\u3066\u3044\u3066\u3082\u5c0f\u6587\u5b57\u3067\u3067\u304d\u3066\u3044\u3066\u3082\u3001\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u898b\u305f\u76ee\u304c\u5927\u6587\u5b57\u304b\u3089\u5c0f\u6587\u5b57\u306b\u306a\u308b\u3060\u3051\u3067\u672c\u8cea\u7684\u306b\u306f\u554f\u984c\u306a\u3044\u306e\u306b\u3001\u308f\u3056\u308f\u3056\u4ed6\u306eSQL\u306e\u4fee\u6b63\u91cf\u3092\u5897\u3084\u3059\u5fc5\u8981\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"Q4-PostgreSQL\u3067\u3082\u30b9\u30c8\u30a2\u30c9\u30fb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306f\u4f7f\u7528\u3067\u304d\u307e\u3059\u304b\uff1f\">Q4. PostgreSQL\u3067\u3082\u30b9\u30c8\u30a2\u30c9\u30fb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306f\u4f7f\u7528\u3067\u304d\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u304c\u3001\u5b8c\u5168\u306b\u4e92\u63db\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002\">A. \u4f7f\u7528\u53ef\u80fd\u3067\u3059\u304c\u3001\u5b8c\u5168\u306b\u4e92\u63db\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/h3>\n<p>PostgreSQL\u306b\u3082\u3001Oracle\u306ePL\/SQL\u306b\u898b\u305f\u76ee\u304c\u305d\u3063\u304f\u308a\u306a\u3001PL\/pgSQL\u3068\u3044\u3046\u8a00\u8a9e\u304c\u3042\u308a\u3001\u540c\u3058\u3088\u3046\u306b\u30b9\u30c8\u30a2\u30c9\u30fb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u304c\u66f8\u3051\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001PL\/SQL\u304c\u69d8\u3005\u306a\u6a5f\u80fd\u3092\u6301\u3061\u3001\u304b\u306a\u308a\u5e83\u7bc4\u56f2\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u306b\u6bd4\u3079\u3001\u6b8b\u5ff5\u306a\u304c\u3089PL\/pgSQL\u306f\u6a5f\u80fd\u7684\u306b\u3082\u6027\u80fd\u7684\u306b\u3082\u52a3\u308a\u307e\u3059\u3002\u3088\u304f\u4f3c\u305f\u6587\u6cd5\u3068\u306f\u3044\u3048\u4fee\u6b63\u3082\u5927\u5909\u3067\u3059\u3057\u3001\u7121\u7406\u306b\u30b9\u30c8\u30a2\u30c9\u30fb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3084\u30b9\u30c8\u30a2\u30c9\u30fb\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u306b\u3059\u308b\u3088\u308a\u3082\u3001\u5225\u306e\u8a00\u8a9e\u306b\u66f8\u304d\u63db\u3048\u308b\u3068\u3044\u3046\u65b9\u6cd5\u3082\u691c\u8a0e\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"Q5-\u8868\u9818\u57df\u306f\u4f5c\u6210\u3067\u304d\u307e\u3059\u304b\uff1f\">Q.5 \u8868\u9818\u57df\u306f\u4f5c\u6210\u3067\u304d\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u540c\u3058\u3088\u3046\u306a\u6a5f\u80fd\u3092\u6301\u3064\u300c\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\">A. \u540c\u3058\u3088\u3046\u306a\u6a5f\u80fd\u3092\u6301\u3064\u300c\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/h3>\n<p>Oracle\u306f\u8868\u9818\u57df\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u4e2d\u306b\u30c6\u30fc\u30d6\u30eb\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Oracle\u3068\u306f\u30d5\u30a1\u30a4\u30ebI\/O\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u304c\u307e\u3063\u305f\u304f\u7570\u306a\u308a\u3001PostgreSQL\u306e\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u3068\u3057\u3066\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u3001\u30c6\u30fc\u30d6\u30eb\u3084\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u5b58\u5728\u3057\u307e\u3059\u3002\u4f7f\u7528\u3059\u308b\u5834\u9762\u3068\u3057\u3066\u306f\u3001\u7570\u306a\u308b\u30c7\u30a3\u30b9\u30af\u306b\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u3092\u914d\u7f6e\u3057\u3066\u8ca0\u8377\u5206\u6563\u3059\u308b\u306a\u3069\u3001\u8868\u9818\u57df\u3068\u305d\u3046\u5909\u308f\u3089\u306a\u3044\u4f7f\u3044\u65b9\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q5_01\" rel=\"attachment wp-att-38254\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38254\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q5_01.png\" alt=\"\" width=\"500\" height=\"225\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\"># mkdir \/var\/lib\/pgsql\/tablespace\r\n# psql\r\npostgres=# CREATE TABLESPACE sample_space LOCAION '\/var\/lib\/pgsql\/tablespace';\r\nCREATE TABLESPACE\r\npostgres=# CREATE TABLE sample (sample numeric) TABLESPACE sample_space;\r\nCREATE TABLE\r\npostgres=# \\d sample\r\n                                  Table \"public.sample\"\r\n Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description\r\n--------+---------+-----------+----------+---------+---------+--------------+-------------\r\n sample | numeric |           |          |         | main    |              | Tablespace: \"sample_space\"\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u3057\u304b\u3057Oracle\u306e\u8868\u9818\u57df\u304c\u521d\u671f\u30b5\u30a4\u30ba\u3084\u6700\u5927\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3067\u304d\u3001\u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u91cf\u3092\u5236\u5fa1\u3067\u304d\u308b\u306e\u306b\u6bd4\u3079\u3001\u30c6\u30fc\u30d6\u30eb\u7a7a\u9593\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306a\u306e\u3067\u30b5\u30a4\u30ba\u306e\u6307\u5b9a\u306f\u3067\u304d\u305a\u3001\u6700\u5927\u30b5\u30a4\u30ba\u306f\u30c7\u30a3\u30b9\u30af\u306e\u9650\u754c\u307e\u3067\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"Q6-REDO\u30ed\u30b0\u30b5\u30a4\u30ba\u306f\u5909\u66f4\u3067\u304d\u307e\u3059\u304b\uff1f\">Q.6 REDO\u30ed\u30b0\u30b5\u30a4\u30ba\u306f\u5909\u66f4\u3067\u304d\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u3067\u304d\u306a\u3044\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u73fe\u5b9f\u7684\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\">A. \u3067\u304d\u306a\u3044\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u73fe\u5b9f\u7684\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/h3>\n<p>Oracle\u3067\u3044\u3046\u3068\u3053\u308d\u306eREDO\u30ed\u30b0\u306f\u3001PostgreSQL\u3067\u306fWAL\u3084WAL\u30d5\u30a1\u30a4\u30eb\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30ed\u30b0\u3068\u547c\u3070\u308c\u307e\u3059\u3002Oracle\u3067\u306fREDO\u30ed\u30b0\u306e\u30b5\u30a4\u30ba\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u304c\u3001PostgreSQL\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306fWAL\u306f1\u306416MB\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306b\u3053\u308c\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u5909\u66f4\u3067\u304d\u308b\u306e\u306f\u3001\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9\u3059\u308b\u3068\u304d\u306e\u307f\u3002\u5b9f\u969b\u306b\u306f\u307b\u3068\u3093\u3069\u884c\u3046\u3053\u3068\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u30011\u306416MB\u306eWAL\u3092\u3069\u306e\u304f\u3089\u3044\u306e\u91cf\u4fdd\u6301\u3059\u308b\u304b\u3001\u3068\u3044\u3046\u8a2d\u5b9a\u306f\u53ef\u80fd\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f1GB\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u4e00\u822c\u7684\u306b\u306f\u5c0f\u3055\u3059\u304e\u307e\u3059\u3002\u6027\u80fd\u306b\u3082\u95a2\u308f\u308b\u8a2d\u5b9a\u3067\u3059\u306e\u3067\u3001\u3088\u304f\u8abf\u3079\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"Q7-\u30b5\u30fc\u30d0\u3067PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3057\u305f\u304c\u3001\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\">Q.7 \u30b5\u30fc\u30d0\u3067PostgreSQL\u3092\u8d77\u52d5\u3057\u307e\u3057\u305f\u304c\u3001\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093<\/h2>\n<h3 id=\"A-listen_addresses\u304b\u3001pg_hbaconf\u306e\u8a2d\u5b9a\u306b\u8aa4\u308a\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002\">A. listen_addresses\u304b\u3001pg_hba.conf\u306e\u8a2d\u5b9a\u306b\u8aa4\u308a\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002<\/h3>\n<p>PostgreSQL\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30ed\u30fc\u30ab\u30eb\u63a5\u7d9a\u306e\u307f\u3092\u8a31\u53ef\u3057\u3066\u3044\u307e\u3059\u3002\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u306e\u63a5\u7d9a\u3092\u8a31\u53ef\u3057\u305f\u3044\u5834\u5408\u3001\u307e\u305apostgresql.conf\u306elisten_addresses\u3092\u300clocalhost\u300d\u304b\u3089\u300c*\u300d\u306b\u5909\u66f4\u3057\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3067\u30ed\u30fc\u30ab\u30eb\u3060\u3051\u3067\u306f\u306a\u304f\u3059\u3079\u3066\u306eIP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u63a5\u7d9a\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3053\u308c\u3060\u3051\u3067\u306f\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002\u3082\u3046\u4e00\u3064\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308bpg_hba.conf\u3092\u4fee\u6b63\u3057\u3001\u30ea\u30e2\u30fc\u30c8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3053\u306e\u3088\u3046\u306b\u3001\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306e\u307f\u3001\u3057\u304b\u3082\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u7121\u3057\u3067\u53d7\u3051\u4ed8\u3051\u308b\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q7_01\" rel=\"attachment wp-att-38253\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38253\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q7_01.png\" alt=\"\" width=\"500\" height=\"128\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code># \"local\" is for Unix domain socket connections only\r\nlocal   all             all                                     trust\r\n# IPv4 local connections:\r\nhost    all             all             127.0.0.1\/32            trust\r\n# IPv6 local connections:\r\nhost    all             all             ::1\/128                 trust\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u3059\u3079\u3066\u306e\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e\u63a5\u7d9a\u3092\u53d7\u3051\u4ed8\u3051\u3001\u304b\u3064\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3092\u5fc5\u9808\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q7_02\" rel=\"attachment wp-att-38252\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38252\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q7_02.png\" alt=\"\" width=\"500\" height=\"127\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code># \"local\" is for Unix domain socket connections only\r\nlocal   all             all                                     md5\r\n# IPv4 local connections:\r\nhost    all             all             0.0.0.0\/0               md5\r\n# IPv6 local connections:\r\nhost    all             all             ::\/0                    md5\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u3053\u308c\u3067\u3082\u63a5\u7d9a\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a\u3092\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u306a\u304a\u3001Oracle\u3068\u7570\u306a\u308a\u3001PostgreSQL\u306b\u306f\u30ea\u30b9\u30ca\u30fc\u3092\u5225\u9014\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u8d77\u52d5\u6642\u306b\u63a5\u7d9a\u5f85\u53d7\u30d7\u30ed\u30bb\u30b9\u304c\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"Q8-\u30e6\u30fc\u30b6\u3092\u4f5c\u3063\u305f\u306e\u306b\u30b9\u30ad\u30fc\u30de\u304c\u4f5c\u6210\u3055\u308c\u307e\u305b\u3093\">Q.8 \u30e6\u30fc\u30b6\u3092\u4f5c\u3063\u305f\u306e\u306b\u30b9\u30ad\u30fc\u30de\u304c\u4f5c\u6210\u3055\u308c\u307e\u305b\u3093<\/h2>\n<h3 id=\"A-PostgreSQL\u3067\u306f\u30e6\u30fc\u30b6\u3068\u30b9\u30ad\u30fc\u30de\u306f\u7121\u95a2\u4fc2\u3067\u3059\u3002\">A. PostgreSQL\u3067\u306f\u30e6\u30fc\u30b6\u3068\u30b9\u30ad\u30fc\u30de\u306f\u7121\u95a2\u4fc2\u3067\u3059\u3002<\/h3>\n<p>Oracle\u3067\u306f\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u3068\u540c\u540d\u306e\u30b9\u30ad\u30fc\u30de\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u5229\u7528\u8005\u306f\u307b\u3068\u3093\u3069\u305d\u306e\u5b58\u5728\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306f\u306a\u304f\u3001\u300c\u30e6\u30fc\u30b6\uff1d\u30b9\u30ad\u30fc\u30de\u300d\u3068\u8003\u3048\u3066\u3082\u554f\u984c\u306a\u3044\u304f\u3089\u3044\u3067\u3059\u3002\u3057\u304b\u3057\u3001PostgreSQL\u3067\u306f\u30e6\u30fc\u30b6\u3068\u30b9\u30ad\u30fc\u30de\u306f\u7121\u95a2\u4fc2\u3067\u3059\u3002<\/p>\n<p>PostgreSQL\u3067\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b\u300cpublic\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u30b9\u30ad\u30fc\u30de\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u901a\u5e38\u306f\u3053\u306e\u30b9\u30ad\u30fc\u30de\u306b\u30c6\u30fc\u30d6\u30eb\u306a\u3069\u3092\u4f5c\u6210\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u7406\u7531\u306f\u300c<code>search_path<\/code>\u300d\u3068\u3044\u3046\u8a2d\u5b9a\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q8_01\" rel=\"attachment wp-att-38251\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38251\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q8_01.png\" alt=\"\" width=\"500\" height=\"84\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# show search_path;\r\n   search_path\r\n-----------------\r\n \"$user\", public\r\n(1 row)\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p><code>search_path<\/code>\u306fCREATE\u3084SELECT\u306a\u3069\u3001SQL\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u53c2\u7167\u3059\u308b\u30b9\u30ad\u30fc\u30de\u306e\u512a\u5148\u9806\u4f4d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u300c<code>\"$user\", public<\/code>\u300d\u3067\u3001\u30e6\u30fc\u30b6\u540d\u3068\u540c\u3058\u30b9\u30ad\u30fc\u30de\u3092\u512a\u5148\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u3088\u3046\u306a\u30b9\u30ad\u30fc\u30de\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5b58\u5728\u3057\u306a\u3044\u306e\u3067\u3001public\u30b9\u30ad\u30fc\u30de\u304c\u512a\u5148\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u30e6\u30fc\u30b6\u540d\u3068\u540c\u3058\u540d\u524d\u306e\u30b9\u30ad\u30fc\u30de\u3092\u4f5c\u6210\u3059\u308c\u3070\u3001Oracle\u3068\u540c\u69d8\u306b\u30e6\u30fc\u30b6\u540d\u3068\u540c\u3058\u30b9\u30ad\u30fc\u30de\u306b\u30c6\u30fc\u30d6\u30eb\u306a\u3069\u304c\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q8_02\" rel=\"attachment wp-att-38250\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38250\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q8_02.png\" alt=\"\" width=\"500\" height=\"196\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# --\u30e6\u30fc\u30b6\u306e\u4f5c\u6210\r\npostgres=# CREATE ROLE maguro LOGIN PASSWORD 'maguro';\r\nCREATE ROLE\r\npostgres=# --maguro\u30b9\u30ad\u30fc\u30de\u3092\u4f5c\u6210\u3057\u3001\u540c\u6642\u306b\u6240\u6709\u8005\u3092maguro\u306b\u3059\u308b\r\npostgres=# CREATE SCHEMA AUTHORIZATION maguro;\r\nCREATE SCHEMA\r\npostgres=# \\dn\r\n  List of schemas\r\n  Name  |  Owner\r\n--------+----------\r\n maguro | maguro\r\n public | postgres\r\n(2 rows)\r\n<\/code><\/pre>\n\n\n--><\/p>\n<h2 id=\"Q9-\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8907\u6570\u4f5c\u308a\u307e\u3057\u305f\u3002\u4e00\u6642\u7684\u306b\u3042\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u843d\u3068\u305b\u307e\u3059\u304b\uff1f\">Q.9 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u8907\u6570\u4f5c\u308a\u307e\u3057\u305f\u3002\u4e00\u6642\u7684\u306b\u3042\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u843d\u3068\u305b\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3060\u3051\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\">A. \u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3060\u3051\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/h3>\n<p>PostgreSQL\u3067\u306f1\u3064\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4e2d\u306b\u8907\u6570\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u8d77\u52d5\u3068\u505c\u6b62\u306f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5358\u4f4d\u3067\u884c\u308f\u308c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5358\u4f4d\u3067\u8d77\u52d5\u30fb\u505c\u6b62\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u3069\u3046\u3057\u3066\u3082\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u8ab0\u3082\u30a2\u30af\u30bb\u30b9\u3055\u305b\u305f\u304f\u306a\u3044\u3001\u3068\u3044\u3046\u3068\u304d\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30b3\u30cd\u30af\u30c8\u6a29\u9650\u3092\u524a\u9664\u3059\u308b\u3001\u3068\u3044\u3046\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q9_01\" rel=\"attachment wp-att-38249\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38249\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q9_01.png\" alt=\"\" width=\"500\" height=\"14\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\"><span class=\"hljs-comment\">-- \u5168\u30e6\u30fc\u30b6\u304b\u3089\u3042\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u30b3\u30cd\u30af\u30c8\u6a29\u9650\u3092\u524a\u9664\u3059\u308b<\/span>\r\n<span class=\"hljs-keyword\">REVOKE<\/span> <span class=\"hljs-keyword\">CONNECT<\/span> <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">DATABASE<\/span> \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d <span class=\"hljs-keyword\">FROM<\/span> <span class=\"hljs-keyword\">PUBLIC<\/span>;\r\n<\/code><\/pre>\n\n\n--><\/p>\n<p>\u3053\u306e\u65b9\u6cd5\u3092\u4f7f\u3048\u3070\u4e0d\u8981\u306a\u63a5\u7d9a\u3092\u6392\u9664\u3067\u304d\u307e\u3059\u304c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30e1\u30e2\u30ea\u4e0a\u304b\u3089\u5b8c\u5168\u306b\u6392\u9664\u3059\u308b\u306e\u306f\u96e3\u3057\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2 id=\"Q10-\u30b5\u30fc\u30d0\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092Shift_JIS\u306b\u3067\u304d\u307e\u3059\u304b\uff1f\">Q10. \u30b5\u30fc\u30d0\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092Shift_JIS\u306b\u3067\u304d\u307e\u3059\u304b\uff1f<\/h2>\n<h3 id=\"A-PostgreSQL\u3067\u306f\u3001\u30b5\u30fc\u30d0\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092Shift_JIS\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\">A. PostgreSQL\u3067\u306f\u3001\u30b5\u30fc\u30d0\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092Shift_JIS\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/h3>\n<p>PostgreSQL\u306f\u69d8\u3005\u306a\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d0\u5074\u306e\u7b26\u53f7\u5316\u65b9\u5f0f\u3068\u3057\u3066Shift_JIS\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u65e5\u672c\u8a9e\u3092\u6271\u3046\u5834\u5408\u306fEUC-JP\u304b\u3001UTF-8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u7b26\u53f7\u5316\u65b9\u5f0f\u3068\u3057\u3066\u306f\u3001Shift_JIS\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002PostgreSQL\u306f\u3001\u30b5\u30fc\u30d0\u5074\u306e\u7b26\u53f7\u5316\u65b9\u5f0f\u304c\u4f55\u3067\u3042\u308c\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u8981\u6c42\u306b\u5bfe\u3057\u7d50\u679c\u3092\u8fd4\u3059\u3068\u304d\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u7b26\u53f7\u5316\u65b9\u5f0f\u306b\u5909\u63db\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30e6\u30fc\u30b6\u304c\u30b5\u30fc\u30d0\u5185\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u304c\u4f55\u3067\u3042\u308b\u304b\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u306f\u3042\u307e\u308a\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u3067\u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u3068\u304d\u306f\u3001<code>client_encoding<\/code>\u3092\u5909\u3048\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/www.ospn.jp\/press\/20190307no49-use-it-oss.html\/q10_01\" rel=\"attachment wp-att-38248\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38248\" src=\"https:\/\/www.ospn.jp\/press\/wp-content\/uploads\/2019\/03\/Q10_01.png\" alt=\"\" width=\"500\" height=\"391\" \/><\/a><\/p>\n<p><!--\n\n\n<pre><code class=\"sql hljs\">postgres=# show client_encoding;\r\n client_encoding\r\n-----------------\r\n SJIS\r\n(1 row)\r\n\r\npostgres=# select * from test;\r\n    num\r\n------------\r\n  \u25b3\u0398\r\n \u30fb\u246e\r\n \u5618\u5100\u6821\r\n \u620e??\r\n ????\u51f8\r\n(5 rows)\r\n\r\npostgres=# set client_encoding = utf8;\r\nSET\r\npostgres=# select * from test;\r\n    num\r\n------------\r\n \u3042\u3044\u3046\u3048\u304a\r\n \u304b\u304d\u304f\u3051\u3053\r\n \u3055\u3057\u3059\u305b\u305d\r\n \u305f\u3061\u3064\u3066\u3068\r\n \u306a\u306b\u306c\u306d\u306e\r\n(5 rows)\r\n<\/code><\/pre>\n\n\n--><\/p>\n<h2 id=\"\u6700\u5f8c\u306b\">\u6700\u5f8c\u306b<\/h2>\n<p>Oracle\u3068\u7570\u306a\u308b\u70b9\u3092\u4e00\u554f\u4e00\u7b54\u5f62\u5f0f\u306710\u7b87\u6240\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002\u57fa\u672c\u7684\u306a\u8cea\u554f\u3060\u3063\u305f\u308a\u3061\u3087\u3063\u3068\u8e0f\u307f\u8fbc\u3093\u3060\u5185\u5bb9\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u304c\u3001\u3059\u3079\u3066\u79c1\u304c\u5b9f\u969b\u306b\u76f4\u9762\u3057\u305f\u308a\u3001Oracle\u30e6\u30fc\u30b6\u306e\u65b9\u306b\u8cea\u554f\u3055\u308c\u305f\u308a\u3057\u305f\u3082\u306e\u3067\u3059\u3002\u3064\u307e\u308a\u3001Oracle\u30e6\u30fc\u30b6\u304cPostgreSQL\u3092\u4f7f\u7528\u3059\u308b\u3068\u304d\u306b\u7591\u554f\u306b\u601d\u3046\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3082\u306e\u3067\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u306e\u30d6\u30ed\u30b0\u3092\u8aad\u307e\u308c\u305f\u65b9\u304cPostgreSQL\u3092\u4f7f\u7528\u3059\u308b\u3068\u304d\u3001\u307e\u305f\u306fPostgreSQL\u306b\u3064\u3044\u3066\u8cea\u554f\u3055\u308c\u305f\u3068\u304d\u306e\u53c2\u8003\u306b\u3057\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u3053\u3053\u306b\u6319\u3052\u305f\u70b9\u4ee5\u5916\u306b\u3082\u5171\u901a\u70b9\u30fb\u76f8\u9055\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\u3054\u8cea\u554f\u7b49\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001<a href=\"https:\/\/twitter.com\/tameguro\" target=\"_blank\" rel=\"noopener\">\u79c1\u306eTwitter<\/a>\u306b\u30ea\u30d7\u30e9\u30a4\u3057\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002\u305d\u308c\u3067\u3082\u89e3\u6c7a\u3057\u306a\u3044\u7591\u554f\u306f\u3001<a href=\"https:\/\/www.postgresql.jp\/\" target=\"_blank\" rel=\"noopener\">\u65e5\u672cPostgreSQL\u30e6\u30fc\u30b6\u4f1a<\/a>\u3078\uff01<\/p>\n<p>============================<\/p>\n<p>\u30b5\u30fc\u30af\u30eb\u300c\u307e\u3050\u308d\u306e\u307f\u305e\u304a\u3061\u300d\u4ee3\u8868<\/p>\n<p>\u307e\u3050\u308d @tameguro<\/p>\n<p>============================<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Oracle\u30e6\u30fc\u30b6\u304cPostgreSQL\u3092\u4f7f\u7528\u3059\u308b\u6642\u306b\u6ce8\u610f\u3059\u308b\u70b9 \u306f\u3058\u3081\u307e\u3057\u3066\u3001\u30b5\u30fc\u30af\u30eb\u300c\u307e\u3050\u308d\u306e\u307f\u305e\u304a\u3061\u300d\u306e\u307e\u3050\u308d\u3068\u7533\u3057\u307e\u3059\u3002 \u5f0a\u30b5\u30fc\u30af\u30eb\u3067\u306f\u4e3b\u306bPostgreSQL\u306b\u95a2\u3059\u308b\u77e5\u8b58\u3092\u540c\u4eba\u8a8c\u306b\u307e\u3068\u3081\u3066\u3001\u3088\u308a\u591a\u304f\u306e\u65b9\u306bPos [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-38114","post","type-post","status-publish","format-standard","hentry","category-use-it-oss"],"_links":{"self":[{"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/posts\/38114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/comments?post=38114"}],"version-history":[{"count":123,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/posts\/38114\/revisions"}],"predecessor-version":[{"id":39791,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/posts\/38114\/revisions\/39791"}],"wp:attachment":[{"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/media?parent=38114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/categories?post=38114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ospn.jp\/press\/wp-json\/wp\/v2\/tags?post=38114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}