{"id":41730,"date":"2023-12-10T09:48:26","date_gmt":"2022-10-12T18:40:16","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/"},"modified":"2024-01-15T11:08:10","modified_gmt":"2024-01-15T03:08:10","slug":"%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/","title":{"rendered":"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu"},"content":{"rendered":"<h1>\u8bf7\u63d0\u4f9b\u4e0b\u5217\u5185\u5bb9\u7684\u4e2d\u6587\u6458\u8981\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a<\/h1>\n<p>\u5728Ubuntu 14.04\u4e0a\u8fdb\u884cPostgreSQL\u7684\u4e3b\u8981\u7248\u672c\u5347\u7ea7\u7684\u65b9\u6cd5\u3002<\/p>\n<h3>\u6ce8\u518c\u5b58\u50a8\u5e93<\/h3>\n<pre class=\"post-pre\"><code>wget --quiet -O - https:\/\/www.postgresql.org\/media\/keys\/ACCC4CF8.asc | sudo apt-key add -\r\nsudo sh -c 'echo \"deb http:\/\/apt.postgresql.org\/pub\/repos\/apt\/ precise-pgdg main\" &gt;&gt; \/etc\/apt\/sources.list.d\/postgresql.list'\r\nsudo apt-get update\r\n<\/code><\/pre>\n<h3>\u5b89\u88c5PostgreSQL 9.4\u7248<\/h3>\n<pre class=\"post-pre\"><code>sudo apt-get install postgresql-9.4 postgresql-server-dev-9.4 postgresql-contrib-9.4\r\n<\/code><\/pre>\n<h3>\u786e\u8ba49.3\u548c9.4\u7684\u7aef\u53e3\u3002<\/h3>\n<p>\u5728\u53e6\u4e00\u4e2a\u7aef\u53e3\u4e0a\u5e76\u884c\u8fd0\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>pg_lsclusters\r\n    Ver Cluster Port Status Owner    Data directory               Log file\r\n    9.3 main    5432 online postgres \/var\/lib\/postgresql\/9.3\/main \/var\/log\/postgresql\/postgresql-9.3-main.log\r\n    9.4 main    5433 online postgres \/var\/lib\/postgresql\/9.4\/main \/var\/log\/postgresql\/postgresql-9.4-main.log\r\n<\/code><\/pre>\n<h3>\u6570\u636e\u8fc1\u79fb<\/h3>\n<p>\u4ece\u8fd0\u884c\u5728\u7aef\u53e35432\u76849.3\u7248\u672c\uff0c\u5207\u6362\u81f3\u8fd0\u884c\u5728\u7aef\u53e35433\u76849.4\u7248\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo su postgres\r\npg_dumpall -p 5432 | psql -d postgres -p 5433\r\n<\/code><\/pre>\n<p>\u8bf7\u53c2\u8003\uff1awww.postgresql.jp<\/p>\n<h3>\u505c\u6b62 PostgreSQL 9.3<\/h3>\n<pre class=\"post-pre\"><code>sudo pg_dropcluster --stop 9.3 main\r\n<\/code><\/pre>\n<h3>\u5c06PostgreSQL 9.4\u66f4\u6539\u7aef\u53e3\u3002<\/h3>\n<p>\u4fee\u6539\u7aef\u53e3\u7684\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>sudo vi \/etc\/postgresql\/9.4\/main\/postgresql.conf\r\n<\/code><\/pre>\n<h3>\u8bf7\u91cd\u65b0\u542f\u52a8 PostgreSQL 9.4<\/h3>\n<pre class=\"post-pre\"><code>sudo service postgresql restart 9.4\r\n<\/code><\/pre>\n<h3>\u6700\u7ec8\u786e\u8ba4<\/h3>\n<pre class=\"post-pre\"><code>pg_lsclusters\r\n    9.4 main    5432 down   postgres \/var\/lib\/postgresql\/9.4\/main \/var\/log\/postgresql\/postgresql-9.4-main.log\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u63d0\u4f9b\u4e0b\u5217\u5185\u5bb9\u7684\u4e2d\u6587\u6458\u8981\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a \u5728Ubuntu 14.04\u4e0a\u8fdb\u884cPostgreSQL\u7684\u4e3b\u8981\u7248\u672c\u5347\u7ea7 [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41730","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06postgresql\u4ece9-3\u5347\u7ea7\u81f39-4-ubuntu\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu\" \/>\n<meta property=\"og:description\" content=\"\u8bf7\u63d0\u4f9b\u4e0b\u5217\u5185\u5bb9\u7684\u4e2d\u6587\u6458\u8981\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a \u5728Ubuntu 14.04\u4e0a\u8fdb\u884cPostgreSQL\u7684\u4e3b\u8981\u7248\u672c\u5347\u7ea7 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06postgresql\u4ece9-3\u5347\u7ea7\u81f39-4-ubuntu\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-12T18:40:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T03:08:10+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/\",\"name\":\"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-10-12T18:40:16+00:00\",\"dateModified\":\"2024-01-15T03:08:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06postgresql\u4ece9-3\u5347\u7ea7\u81f39-4-ubuntu\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu","og_description":"\u8bf7\u63d0\u4f9b\u4e0b\u5217\u5185\u5bb9\u7684\u4e2d\u6587\u6458\u8981\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1a \u5728Ubuntu 14.04\u4e0a\u8fdb\u884cPostgreSQL\u7684\u4e3b\u8981\u7248\u672c\u5347\u7ea7 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06postgresql\u4ece9-3\u5347\u7ea7\u81f39-4-ubuntu\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-10-12T18:40:16+00:00","article_modified_time":"2024-01-15T03:08:10+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/","name":"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-10-12T18:40:16+00:00","dateModified":"2024-01-15T03:08:10+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5c06PostgreSQL\u4ece9.3\u5347\u7ea7\u81f39.4-ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86postgresql%e4%bb%8e9-3%e5%8d%87%e7%ba%a7%e8%87%b39-4-ubuntu%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=41730"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41730\/revisions"}],"predecessor-version":[{"id":58906,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41730\/revisions\/58906"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=41730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=41730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=41730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}