{"id":4704,"date":"2015-03-16T09:41:29","date_gmt":"2015-03-16T07:41:29","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=4704"},"modified":"2015-03-17T10:20:53","modified_gmt":"2015-03-17T08:20:53","slug":"mysql_fdw","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=4704","title":{"rendered":"[postgresql] \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 mysql \u0447\u0435\u0440\u0435\u0437 mysql_fdw"},"content":{"rendered":"<p>\u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 <strong>mysql<\/strong> \u0432 <strong>postgresql<\/strong>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0441\u0430\u043c\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/EnterpriseDB\/mysql_fdw\" target=\"_blank\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/p>\n<p>\u0412 \u043c\u043e\u0451\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435, \u0431\u044b\u043b \u0430\u043f\u0433\u0440\u0435\u0439\u0434 postgresql \u0441 <strong>9.3<\/strong> \u0434\u043e <strong>9.4<\/strong> \u0441 \u043d\u0435\u043a\u0438\u043c\u0438 &#8220;\u0441\u044e\u0440\u043f\u0440\u0438\u0437\u0430\u043c\u0438&#8221;. \u0410 \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0438\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 <strong>9.3<\/strong> \u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f <strong>mysql_fdw<\/strong> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u043e\u043f\u0446\u0438\u0438 <strong>address\/query<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u043d\u043e\u0432\u043e\u0439. \u0418 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0<strong>pg_upgrade<\/strong> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0443\u0433\u0430\u043d\u044c \u043d\u0430 \u044d\u0442\u043e. \u041a\u0430\u043a \u0431\u044b\u0442\u044c? \u0410 \u043f\u043b\u0430\u043d \u0442\u0430\u043a\u043e\u0439 (\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0444\u043e\u0440\u0443\u043c\u043e\u0432):<\/p>\n<p><em><span style=\"color: #ff6600;\">1) \u043f\u043e\u0434\u0441\u0443\u043d\u0443\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c mysql_fdw \u0432 9.3.<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\"> 2) \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c\/\u0443\u0434\u0430\u043b\u0438\u0442\u044c deprecated \u043e\u043f\u0446\u0438\u0438<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\"> 3) \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e upgrade.<\/span><\/em><\/p>\n<p><!--more--><\/p>\n<p>\u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e <strong>address<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f <strong>host<\/strong>. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c:<\/p>\n<p><code>postgres=# ALTER SERVER mysql_slave OPTIONS(DROP address);<br \/>\npostgres=# ALTER SERVER mysql_slave OPTIONS(ADD host '192.168.0.230');<\/code><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 <strong>query<\/strong> \u043e\u043f\u0446\u0438\u0438 (\u0442\u0430\u043a \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0435\u0442):<\/p>\n<p><code>postgres=# ALTER FOREIGN TABLE mysql.newtable OPTIONS(DROP query);<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u0440\u0443\u0433\u0430\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c <strong>upgrade<\/strong>:<\/p>\n<p><code># su postgres -c \"\/usr\/postgres\/9.4\/bin\/amd64\/pg_upgrade -d \/var\/postgres\/9.3_new -D \/var\/postgres\/9.4 -b \/usr\/postgres\/9.3\/bin\/amd64\/ -B \/usr\/postgres\/9.4\/bin\/amd64\/\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 mysql \u0432 postgresql. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0441\u0430\u043c\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0412 \u043c\u043e\u0451\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435, \u0431\u044b\u043b \u0430\u043f\u0433\u0440\u0435\u0439\u0434 postgresql \u0441 9.3 \u0434\u043e 9.4 \u0441 \u043d\u0435\u043a\u0438\u043c\u0438 &#8220;\u0441\u044e\u0440\u043f\u0440\u0438\u0437\u0430\u043c\u0438&#8221;. \u0410 \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0438\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 9.3 \u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f mysql_fdw \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u043e\u043f\u0446\u0438\u0438 address\/query, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4704","post","type-post","status-publish","format-standard","hentry","category-databases"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4704"}],"version-history":[{"count":4,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4704\/revisions"}],"predecessor-version":[{"id":4717,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/4704\/revisions\/4717"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}