{"id":11583,"date":"2023-05-12T09:55:54","date_gmt":"2023-05-12T00:55:54","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=11583"},"modified":"2023-07-14T20:56:03","modified_gmt":"2023-07-14T11:56:03","slug":"postgresql%e3%81%a7db%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%ef%bc%81%ef%bc%88pg_dump%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/11583","title":{"rendered":"PostgreSQL\u3067DB\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u3092\u884c\u3046\uff01\uff08pg_dump\uff0fpsql\uff09"},"content":{"rendered":"<p>PostgreSQL\u3067\u3001pg_dump\u30b3\u30de\u30f3\u30c9\u3067\u3001DB\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_dump\uff09<\/h2>\n<p>pg_dump\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u5f62\u5f0f\u3067DB\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u3001\u300cinventory\u300d\u3068\u3044\u3046DB\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\/inventory.sql inventory\r\n$ ls -l .\/backups\/inventory.sql \r\n-rw-r--r--. 1 postgres postgres 2264 May 13 13:07 .\/backups\/inventory.sql\r\n<\/pre>\n<h2>DB\u306e\u30ea\u30b9\u30c8\u30a2\u3092\u884c\u3046\uff01\uff08psql\uff09<\/h2>\n<p>\u30ea\u30b9\u30c8\u30a2\u306f\u3001DB\u3092\u6307\u5b9a\u3057\u3066\u884c\u3044\u307e\u3059\u3002\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\u3001\u30c6\u30fc\u30d6\u30eb\u7b49\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\/inventory.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\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u306f\u3001pg_dump\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_dump\u30b3\u30de\u30f3\u30c9\u3067\u3001DB\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":[715,289,709,511,576],"class_list":["post-11583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-pg_dump","tag-postgresql","tag-psql","tag-511","tag-576"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11583","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=11583"}],"version-history":[{"count":9,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11583\/revisions"}],"predecessor-version":[{"id":11651,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/11583\/revisions\/11651"}],"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=11583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=11583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=11583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}