{"id":2332,"date":"2024-10-03T04:44:12","date_gmt":"2024-10-02T19:44:12","guid":{"rendered":"https:\/\/www.next-hop.net\/blog\/hiraga\/?p=2332"},"modified":"2026-01-06T09:58:32","modified_gmt":"2026-01-06T00:58:32","slug":"upgrade-postgresql","status":"publish","type":"post","link":"https:\/\/www.next-hop.net\/blog\/hiraga\/freebsd\/upgrade-postgresql\/","title":{"rendered":"PostgreSQL\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3059\u308b"},"content":{"rendered":"<p>pg_upgrade\u306fFreeBSD\u3067\u306f\u4f7f\u3044\u306b\u304f\u3044\u306e\u3067\u3001\u30c0\u30f3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0<\/h2>\n<ul>\n<li>FreeBSD 13.4<\/li>\n<li>\u65e7: PostgreSQL 15<\/li>\n<li>\u65b0: PostgreSQL 16<\/li>\n<\/ul>\n<h4>upgrade-postgresql.sh<\/h4>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh\r\n\r\nOLD_VER=15\r\nNEW_VER=16\r\nDUMP_FILE=&quot;postgresql.dump&quot;\r\nPG_USER=&quot;postgres&quot;\r\n\r\ntouch ${DUMP_FILE}\r\nchown ${PG_USER} ${DUMP_FILE}\r\nchmod 600 ${DUMP_FILE}\r\n\r\nsu ${PG_USER} -c &quot;pg_dumpall &gt; ${DUMP_FILE}&quot;\r\nservice postgresql stop\r\n\r\npkg remove -y postgresql${OLD_VER}-client\r\npkg install -y postgresql${NEW_VER}-server\r\n\r\nservice postgresql initdb\r\nservice postgresql start\r\n\r\nsu ${PG_USER} -c &quot;psql -d postgres -f ${DUMP_FILE}&quot;\r\n\r\nrm -f ${DUMP_FILE}\r\n<\/pre>\n<h2>\u53c2\u8003<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.postgresql.jp\/docs\/16\/upgrading.html\">19.6. PostgreSQL\u30af\u30e9\u30b9\u30bf\u306e\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u51e6\u7406<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>pg_upgrade\u306fFreeBSD\u3067\u306f\u4f7f\u3044\u306b\u304f\u3044\u306e\u3067\u3001\u30c0\u30f3\u30d7\u3068\u30ea\u30b9\u30c8\u30a2\u3092\u4f7f\u3044\u307e\u3059\u3002 \u524d\u63d0 FreeBSD 13.4 \u65e7: PostgreSQL 15 \u65b0: PostgreSQL 16 upgrade-postgresq\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.next-hop.net\/blog\/hiraga\/freebsd\/upgrade-postgresql\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-2332","post","type-post","status-publish","format-standard","hentry","category-freebsd"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/2332"}],"collection":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/comments?post=2332"}],"version-history":[{"count":8,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/2332\/revisions"}],"predecessor-version":[{"id":2733,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/posts\/2332\/revisions\/2733"}],"wp:attachment":[{"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/media?parent=2332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/categories?post=2332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.next-hop.net\/blog\/hiraga\/wp-json\/wp\/v2\/tags?post=2332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}