{"id":11594,"date":"2023-05-13T13:12:34","date_gmt":"2023-05-13T04:12:34","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=11594"},"modified":"2023-07-13T19:46:45","modified_gmt":"2023-07-13T10:46:45","slug":"postgresql%e3%81%a7db%e7%92%b0%e5%a2%83%e5%85%a8%e4%bd%93%e3%81%ae%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97%e3%81%a8%e3%83%aa%e3%82%b9%e3%83%88%e3%82%a2%e3%82%92%e8%a1%8c%e3%81%86","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/11594","title":{"rendered":"PostgreSQL\u3067DB\u74b0\u5883\u5168\u4f53\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u3092\u884c\u3046\uff01\uff08pg_dumpall\uff0fpsql\uff09"},"content":{"rendered":"<p>PostgreSQL\u3067\u3001pg_dumpall\u30b3\u30de\u30f3\u30c9\u3067\u3001DB\u74b0\u5883\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>DB\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3059\u308b\uff01\uff08pg_dumpall\uff09<\/h2>\n<p>pg_dump\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u5f62\u5f0f\u3067DB\u74b0\u5883\u5168\u4f53\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ pg_dump -U postgres  --clean --if-exists -f .\/backups\/dumpall.sql\r\n$ ls -l .\/backups\/dumpall.sql\r\n-rw-r--r--. 1 postgres postgres 2264 May 13 13:10 .\/backups\/dumpall.sql\r\n<\/pre>\n<h2>DB\u74b0\u5883\u5168\u4f53\u306e\u30ea\u30b9\u30c8\u30a2\u3092\u884c\u3046\uff01\uff08psql\uff09<\/h2>\n<p>\u300c--clean\u300d\u3001\u300c--if-exists \u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u306a\u3044\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u305f\u5834\u5408\u306f\u3001DB\u74b0\u5883\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u524a\u9664\u3057\u3066\u304b\u3089\u30ea\u30b9\u30c8\u30a2\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ psql inventory &lt; .\/backups\/dumpall.sql\r\nSET\r\nSET\r\nSET\r\nSET\r\nSET\r\n set_config \r\n------------\r\n \r\n(1 row)\r\n\r\nSET\r\nSET\r\nSET\r\nSET\r\nALTER TABLE\r\nALTER TABLE\r\nALTER TABLE\r\nDROP TABLE\r\nSET\r\nSET\r\nCREATE TABLE\r\nALTER TABLE\r\nCOPY 1\r\nALTER TABLE\r\nALTER TABLE\r\nALTER TABLE\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>PostgreSQL\u306eDB\u74b0\u5883\u5168\u4f53\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u306f\u3001pg_dumpall\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.postgresql.org\/\" target=\"_blank\" rel=\"noopener\">PostgreSQL: The World's Most Advanced Open Source Relational Database<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/10238\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/05\/eyecatch_postgresql_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">PostgreSQL\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u53c2\u8003\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=B0BLY4SPC4&linkId=74585e7caebda2fa1613b0bd5bafb3cf\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL\u3067\u3001pg_dumpall\u30b3\u30de\u30f3\u30c9\u3067\u3001DB\u74b0\u5883\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":11332,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221],"tags":[522,708,289,709,511,576],"class_list":["post-11594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-db","tag-pg_dumpall","tag-postgresql","tag-psql","tag-511","tag-576"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=11594"}],"version-history":[{"count":5,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11594\/revisions"}],"predecessor-version":[{"id":11654,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11594\/revisions\/11654"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/11332"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=11594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=11594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=11594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}