{"id":399,"date":"2018-07-07T16:17:59","date_gmt":"2018-07-07T07:17:59","guid":{"rendered":"http:\/\/shinke1987.net\/?p=399"},"modified":"2018-07-07T16:17:59","modified_gmt":"2018-07-07T07:17:59","slug":"post-399","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=399","title":{"rendered":"PostgreSQL\u3092Access\u304b\u3089\u64cd\u4f5c\u3059\u308b\u3002"},"content":{"rendered":"<h2>\u74b0\u5883<\/h2>\n<p>OS\uff1aCentOS7 ( FW\u306fOFF\u306b\u3057\u3066\u3044\u308b )<br \/>\nPostgreSQL\uff1aVer9.2.23<br \/>\nACCESS\uff1aACCESS2016<\/p>\n<h2>\u6ce8\u610f<\/h2>\n<p>CPU\u304c64bit\u306e\u3082\u306e\u306a\u3089\u3001<br \/>\nOffice\u308264bit\u7248\u3092\u5165\u308c\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002<br \/>\nODBC\u30c9\u30e9\u30a4\u30d0\u306f32bit\u7248\u306864bit\u7248\u304c\u3042\u308b\u304c\u3001<br \/>\nOS\u306f64bit\u3001ODBC\u30c9\u30e9\u30a4\u30d0\u308264bit\u3001<br \/>\nACCESS2016\u304c32bit\u3001\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u4e0d\u6574\u5408\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3002<br \/>\nOffice\u88fd\u54c1\u3067\u300132bit\u306864bit\u306e\u6df7\u5728\u306f\u4e0d\u53ef\u3002<br \/>\n\uff08Visio\u306f32bit\u3001ACCESS\u306f64bit\u306e\u7d44\u307f\u5408\u308f\u305b\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u3044\uff09<\/p>\n<h2>\u4f5c\u696d\u5185\u5bb9<\/h2>\n<p>CentOS7\u306bPostgreSQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo yum -y install postgresql-server<\/pre>\n<p>1\u5ea6root\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ su<\/pre>\n<p>\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># chmod 757 \/usr\/local<\/pre>\n<p>postgres\u30e6\u30fc\u30b6\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ su postgres\r\n$ cd \/var\/lib\/pgsql\/data<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u30bf\uff08\u5168\u3066\u306e\u30c7\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u308b\u5834\u6240\uff09\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ initdb -D \/usr\/local\/pgsql\/data<\/pre>\n<p>root\u306b\u623b\u3063\u3066\u3001\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5143\u306b\u623b\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># chmod 755 \/usr\/local<\/pre>\n<p>\u307e\u305fpostgres\u30e6\u30fc\u30b6\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># su postgres<\/pre>\n<p>postgresql-setup \u306a\u308b\u30b3\u30de\u30f3\u30c9\u3082\u3042\u308b\u3089\u3057\u3044\u306e\u3067\u305d\u308c\u3082\u5ff5\u306e\u305f\u3081\u5b9f\u884c\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ postgresql-setup initdb<\/pre>\n<p>\u3053\u308c\u3042\u308c\u3070\u3001\u4e0a\u306einitdb\u30b3\u30de\u30f3\u30c9\u306f\u3084\u3089\u306a\u304f\u3066\u826f\u304b\u3063\u305f\u304b\u3082\u3002<\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ vi \/var\/lib\/pgsql\/data\/postgresql.conf<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">listen_addresses = '*'<\/pre>\n<p>\u3053\u306e1\u884c\u3092\u8ffd\u52a0\u3057\u305f\u3002\uff08\u30b5\u30fc\u30d0\u304c\u3069\u306eIP\u30a2\u30c9\u30ec\u30b9\u3067\u53d7\u3051\u4ed8\u3051\u308b\u304b\u3092\u6307\u5b9a\u3059\u308b\uff09<\/p>\n<p>\u63a5\u7d9a\u3067\u304d\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5236\u9650\u306e\u8a2d\u5b9a\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ vi \/var\/lib\/pgsql\/data\/pg_hba.conf<\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306b\u3001<br \/>\nlocal all all peer<br \/>\n\u3068\u304b\u66f8\u304b\u308c\u305f\u884c\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u5168\u3066#\u3067\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3059\u308b\u3002<br \/>\n\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">local all all password\r\nhost all all 127.0.0.1\/32 password\r\nhost all all ::1\/128 password\r\nhost all all 192.168.1.0\/24 password<\/pre>\n<p>\u3092\u8ffd\u52a0\u3057\u305f\u3002<br \/>\n\uff08\u6700\u5f8c\u306f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3051\u3069\u3001<br \/>\n\u305d\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306eIP\u30a2\u30c9\u30ec\u30b9\u5168\u3066\u53d7\u3051\u4ed8\u3051\u308b\u3068\u3044\u3046\u610f\u5473\uff09<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ psql -l<\/pre>\n<p>\u3068\u3084\u3063\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ psql<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u3057\u3066psql\u306b\u5165\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ create database test_db;<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ \\c test_db;<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u5207\u308a\u66ff\u3048\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ create table test ( id integer, name text );<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ insert into test values ( 0, 'tanaka' );<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u30c7\u30fc\u30bf\u3092\u633f\u5165\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ select * from test;<\/pre>\n<p>\u3068\u6253\u3063\u3066\u3001\u633f\u5165\u3057\u305f\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3002<\/p>\n<p>PostgreSQL\u306eODBC\u30c9\u30e9\u30a4\u30d0\u3092Windows\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u3067\u3001<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u6b21\u306eURL\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002<br \/>\n<a href=\"https:\/\/www.postgresql.org\/ftp\/odbc\/versions\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.postgresql.org\/ftp\/odbc\/versions\/<\/a><br \/>\n32bit\u7248\u306864bit\u7248\u304c\u3042\u308b\u3051\u3069\u3001<br \/>\nACCESS2016\u306e32bit\u7248\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u308b\u306a\u3089\u3001ODBC\u30c9\u30e9\u30a4\u30d0\u308232bit\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\uff08CPU\u308232bit\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\uff09<br \/>\nACCESS2016\u306e64bit\u7248\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u308b\u306a\u3089\u3001ODBC\u30c9\u30e9\u30a4\u30d0\u308264bit\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\uff08CPU\u308264bit\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\uff09<br \/>\nmsi\u30d5\u30a9\u30eb\u30c0\u306e1\u756a\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u9ad8\u3044\u3082\u306e\u3092\u9078\u3079\u3070\u826f\u3044\u306f\u305a\u3002<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\uff08Win7\u306e\u5834\u5408\uff09<br \/>\n\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb\u2192\u7ba1\u7406\u30c4\u30fc\u30eb\u2192\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9(ODBC)\u3092\u8d77\u52d5\u3057\u3066\u3001<br \/>\n\u30e6\u30fc\u30b6\u30fcDSN\u30bf\u30d6\u306e\u8ffd\u52a0\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001<br \/>\n\u51fa\u3066\u304d\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u5404\u7a2e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u30c6\u30b9\u30c8\u304c\u5b8c\u4e86\u3057\u305f\u3089<br \/>\n\u4fdd\u5b58\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p>\u6b21\u306bACCESS2016\u3092\u8d77\u52d5\u3057\u3066\u3001\u7a7a\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u958b\u304f\u3002<br \/>\n\u300c\u5916\u90e8\u30c7\u30fc\u30bf\u300d\u30bf\u30d6\u306e\u300c\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u300d\u2192\u300c\u4ed6\u306e\u30bd\u30fc\u30b9\u304b\u3089\u300d<br \/>\n\u2192\u300cODBC\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u3001<br \/>\n\u300c\u30ea\u30f3\u30af\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u30bd\u30fc\u30b9\u30c7\u30fc\u30bf\u306b\u30ea\u30f3\u30af\u3059\u308b\u300d\u3092\u9078\u629e\u3057\u3066OK\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306e\u9078\u629e\u3068\u3044\u3046\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u3001<br \/>\n\u300c\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u300d\u30bf\u30d6\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001<br \/>\n\u300cPostgreSQL_Test\uff08\u3055\u3063\u304d\u4f5c\u6210\u3057\u305f\u3082\u306e\uff09\u300d\u3092\u9078\u629e\u3057\u3066OK\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u30c6\u30fc\u30d6\u30eb\u306e\u30ea\u30f3\u30af\u3068\u3044\u3046\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u3001<br \/>\n\u300cpublic.test\u300d\u3092\u9078\u629e\u3057\u3066OK\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u56fa\u6709\u30ec\u30b3\u30fc\u30c9\u8b58\u5225\u5b50\u306e\u9078\u629e\u3068\u3044\u3046\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u3001<br \/>\n\u4e3b\u30ad\u30fc\u3092\u9078\u629e\u3057\u3066OK\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\uff08\u4e3b\u30ad\u30fc\u3092\u9078\u629e\u3057\u306a\u3044\u3068ACCESS2016\u304b\u3089\u66f4\u65b0\u304c\u3067\u304d\u306a\u304f\u306a\u308b\uff09<br \/>\n\u5de6\u306b\u30c6\u30fc\u30d6\u30eb\u540d\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u3001\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n\u66f4\u65b0\u3082\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f\u3089\u3001\u3053\u308c\u3067\u5b8c\u4e86\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u74b0\u5883 OS\uff1aCentOS7 ( FW\u306fOFF\u306b\u3057\u3066\u3044\u308b ) PostgreSQL\uff1aVer9.2.23 ACCESS\uff1aACCESS2016 \u6ce8\u610f CPU\u304c64bit\u306e\u3082\u306e\u306a\u3089\u3001 Office\u308264bit\u7248\u3092\u5165\u308c\u3066\u304a\u304f\u5fc5\u8981\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,16],"tags":[58,57,17],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-postgresql","category-windows","tag-access","tag-postgresql","tag-windows"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":1,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":400,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions\/400"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}